feat: 增加moonshot api集成

moonshot本来可直接使用openai sdk,
但是要求openai sdk必须在1.0以上,与本项目冲突,
故现使用http接口对接的方式集成
This commit is contained in:
weishao zeng
2024-03-27 15:02:51 +08:00
parent b8cc62ae95
commit 38e1db7a37
5 changed files with 203 additions and 0 deletions

View File

@@ -46,6 +46,9 @@ class Bridge(object):
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.chat_bots = {}
# 模型对应的接口