From a3038d04723524bfb80fe2a75e36fc2487236064 Mon Sep 17 00:00:00 2001 From: taylor Date: Sun, 13 Oct 2024 16:04:08 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E6=B7=BB=E5=8A=A0ollama=E8=B0=83?= =?UTF-8?q?=E7=94=A8AI=20chat=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base-config.yaml | 1 + maubot.yaml | 1 - maubot_llmplus/aibot.py | 6 +++--- {maubot_platform => maubot_llmplus}/local_paltform.py | 4 ++-- {maubot_platform => maubot_llmplus}/platforms.py | 0 {maubot_platform => maubot_llmplus}/thrid_platform.py | 2 +- maubot_platform/__init__.py | 0 7 files changed, 7 insertions(+), 7 deletions(-) rename {maubot_platform => maubot_llmplus}/local_paltform.py (93%) rename {maubot_platform => maubot_llmplus}/platforms.py (100%) rename {maubot_platform => maubot_llmplus}/thrid_platform.py (93%) delete mode 100644 maubot_platform/__init__.py diff --git a/base-config.yaml b/base-config.yaml index 87b546c..63cae4e 100644 --- a/base-config.yaml +++ b/base-config.yaml @@ -17,6 +17,7 @@ platforms: api_key: model: llama3.2 max_words: 1000 + max_context_messages: 100 openai: url: api_key: diff --git a/maubot.yaml b/maubot.yaml index ef8c5ac..75360a1 100644 --- a/maubot.yaml +++ b/maubot.yaml @@ -3,7 +3,6 @@ id: cn.tayxie.llmplus version: 1.0.0 license: MIT modules: - - maubot_platform - maubot_llmplus main_class: AiBotPlugin config: true diff --git a/maubot_llmplus/aibot.py b/maubot_llmplus/aibot.py index 7237533..0870cea 100644 --- a/maubot_llmplus/aibot.py +++ b/maubot_llmplus/aibot.py @@ -7,9 +7,9 @@ from mautrix.types import Format, TextMessageEventContent, EventType, MessageTyp from mautrix.util import markdown from mautrix.util.config import BaseProxyConfig, ConfigUpdateHelper -from maubot_platform.local_paltform import Ollama, LmStudio -from maubot_platform import Platform -from maubot_platform.thrid_platform import OpenAi, Anthropic +from maubot_llmplus.local_paltform import Ollama, LmStudio +from maubot_llmplus.platforms import Platform +from maubot_llmplus.thrid_platform import OpenAi, Anthropic """ 配置文件加载 diff --git a/maubot_platform/local_paltform.py b/maubot_llmplus/local_paltform.py similarity index 93% rename from maubot_platform/local_paltform.py rename to maubot_llmplus/local_paltform.py index 576c7f0..8f16d25 100644 --- a/maubot_platform/local_paltform.py +++ b/maubot_llmplus/local_paltform.py @@ -3,8 +3,8 @@ import json from mautrix.types import MessageEvent from mautrix.util.config import BaseProxyConfig -from maubot_platform import platforms -from maubot_platform.platforms import Platform, ChatCompletion +from maubot_llmplus import platforms +from maubot_llmplus.platforms import Platform, ChatCompletion class Ollama(Platform): diff --git a/maubot_platform/platforms.py b/maubot_llmplus/platforms.py similarity index 100% rename from maubot_platform/platforms.py rename to maubot_llmplus/platforms.py diff --git a/maubot_platform/thrid_platform.py b/maubot_llmplus/thrid_platform.py similarity index 93% rename from maubot_platform/thrid_platform.py rename to maubot_llmplus/thrid_platform.py index 4b50b71..33d58d4 100644 --- a/maubot_platform/thrid_platform.py +++ b/maubot_llmplus/thrid_platform.py @@ -1,7 +1,7 @@ from mautrix.types import MessageEvent from mautrix.util.config import BaseProxyConfig -from maubot_platform.platforms import Platform, ChatCompletion +from maubot_llmplus.platforms import Platform, ChatCompletion class OpenAi(Platform): diff --git a/maubot_platform/__init__.py b/maubot_platform/__init__.py deleted file mode 100644 index e69de29..0000000