diff --git a/xiaogpt/bot/glm_bot.py b/xiaogpt/bot/glm_bot.py index 98799f1f..7d896162 100644 --- a/xiaogpt/bot/glm_bot.py +++ b/xiaogpt/bot/glm_bot.py @@ -11,13 +11,11 @@ class GLMBot(ChatHistoryMixin, BaseBot): name = "Chat GLM" - default_options = {"model": "chatglm_turbo"} + default_options = {"model": "glm-4"} # Change glm model here def __init__(self, glm_key: str) -> None: from zhipuai import ZhipuAI - self.model = "glm-4" # Change glm model here - self.history = [] self.client = ZhipuAI(api_key=glm_key) @@ -28,7 +26,6 @@ def from_config(cls, config): def ask(self, query, **options): ms = self.get_messages() kwargs = {**self.default_options, **options} - kwargs["model"] = self.model ms.append({"role": "user", "content": f"{query}"}) kwargs["messages"] = ms try: @@ -45,7 +42,6 @@ def ask(self, query, **options): async def ask_stream(self, query: str, **options: Any): ms = self.get_messages() kwargs = {**self.default_options, **options} - kwargs["model"] = self.model ms.append({"role": "user", "content": f"{query}"}) kwargs["messages"] = ms kwargs["stream"] = True diff --git a/xiaogpt/bot/qwen_bot.py b/xiaogpt/bot/qwen_bot.py index 17ef8f0a..a5cbc1a7 100644 --- a/xiaogpt/bot/qwen_bot.py +++ b/xiaogpt/bot/qwen_bot.py @@ -15,7 +15,6 @@ class QwenBot(ChatHistoryMixin, BaseBot): def __init__(self, qwen_key: str) -> None: import dashscope - from dashscope.api_entities.dashscope_response import Role self.history = [] dashscope.api_key = qwen_key