feat: document summary and chat with content

This commit is contained in:
zhayujie
2023-09-24 12:27:09 +08:00
parent b6b76be4f6
commit 55cc35efa9
11 changed files with 261 additions and 13 deletions

View File

@@ -32,6 +32,7 @@ class Bridge(object):
if model_type in ["claude"]:
self.btype["chat"] = const.CLAUDEAI
self.bots = {}
self.chat_bots = {}
def get_bot(self, typename):
if self.bots.get(typename) is None:
@@ -61,6 +62,11 @@ class Bridge(object):
def fetch_translate(self, text, from_lang="", to_lang="en") -> Reply:
return self.get_bot("translate").translate(text, from_lang, to_lang)
def find_chat_bot(self, bot_type: str):
if self.chat_bots.get(bot_type) is None:
self.chat_bots[bot_type] = create_bot(bot_type)
return self.chat_bots.get(bot_type)
def reset_bot(self):
"""
重置bot路由