Browse Source

fix: model config

master
zhayujie 6 months ago
parent
commit
fb72b601aa
1 changed files with 7 additions and 5 deletions
  1. +7
    -5
      bridge/bridge.py

+ 7
- 5
bridge/bridge.py View File

@@ -39,20 +39,22 @@ class Bridge(object):
if model_type and model_type.startswith("claude-3"): if model_type and model_type.startswith("claude-3"):
self.btype["chat"] = const.CLAUDEAPI self.btype["chat"] = const.CLAUDEAPI


if model_type in ["claude"]:
self.btype["chat"] = const.CLAUDEAI

if model_type in ["moonshot-v1-8k", "moonshot-v1-32k", "moonshot-v1-128k"]:
self.btype["chat"] = const.MOONSHOT

if conf().get("use_linkai") and conf().get("linkai_api_key"): if conf().get("use_linkai") and conf().get("linkai_api_key"):
self.btype["chat"] = const.LINKAI self.btype["chat"] = const.LINKAI
if not conf().get("voice_to_text") or conf().get("voice_to_text") in ["openai"]: if not conf().get("voice_to_text") or conf().get("voice_to_text") in ["openai"]:
self.btype["voice_to_text"] = const.LINKAI self.btype["voice_to_text"] = const.LINKAI
if not conf().get("text_to_voice") or conf().get("text_to_voice") in ["openai", const.TTS_1, const.TTS_1_HD]: if not conf().get("text_to_voice") or conf().get("text_to_voice") in ["openai", const.TTS_1, const.TTS_1_HD]:
self.btype["text_to_voice"] = const.LINKAI self.btype["text_to_voice"] = const.LINKAI
if model_type in ["claude"]:
self.btype["chat"] = const.CLAUDEAI

if model_type in ["moonshot-v1-8k", "moonshot-v1-32k", "moonshot-v1-128k"]:
self.btype["chat"] = const.MOONSHOT


self.bots = {} self.bots = {}
self.chat_bots = {} self.chat_bots = {}

# 模型对应的接口 # 模型对应的接口
def get_bot(self, typename): def get_bot(self, typename):
if self.bots.get(typename) is None: if self.bots.get(typename) is None:


Loading…
Cancel
Save