mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-03-18 04:25:14 +08:00
fix: rename zhipu bot_type, persist bot_type in web config, fix re.sub escape error
- Rename ZHIPU_AI bot type from glm-4 to zhipu to avoid confusion with model names - Add bot_type persistence in web config to fix provider dropdown resetting on refresh - Change OpenAI provider key to chatGPT to match bot_factory routing - Add DEEPSEEK constant and route it to ChatGPTBot (OpenAI-compatible API) - Keep backward compatibility for legacy bot_type glm-4 in bot_factory - Fix re.sub bad escape error on Windows paths by using lambda replacement - Remove unused pydantic import in minimax_bot.py Made-with: Cursor
This commit is contained in:
@@ -17,8 +17,7 @@ def create_bot(bot_type):
|
||||
from models.baidu.baidu_wenxin import BaiduWenxinBot
|
||||
return BaiduWenxinBot()
|
||||
|
||||
elif bot_type == const.CHATGPT:
|
||||
# ChatGPT 网页端web接口
|
||||
elif bot_type in (const.CHATGPT, const.DEEPSEEK): # DeepSeek uses OpenAI-compatible API
|
||||
from models.chatgpt.chat_gpt_bot import ChatGPTBot
|
||||
return ChatGPTBot()
|
||||
|
||||
@@ -53,7 +52,7 @@ def create_bot(bot_type):
|
||||
from models.gemini.google_gemini_bot import GoogleGeminiBot
|
||||
return GoogleGeminiBot()
|
||||
|
||||
elif bot_type == const.ZHIPU_AI:
|
||||
elif bot_type == const.ZHIPU_AI or bot_type == "glm-4": # "glm-4" kept for backward compatibility
|
||||
from models.zhipuai.zhipuai_bot import ZHIPUAIBot
|
||||
return ZHIPUAIBot()
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import time
|
||||
import json
|
||||
from pydantic.types import T
|
||||
import requests
|
||||
|
||||
from models.bot import Bot
|
||||
|
||||
Reference in New Issue
Block a user