feat: bring in openai completion api

This commit is contained in:
zhayujie
2022-12-17 23:08:08 +08:00
parent f8fec2ef5b
commit e5e0979bfa
11 changed files with 107 additions and 43 deletions

View File

@@ -2,9 +2,6 @@
channel factory
"""
from bot.baidu.baidu_unit_bot import BaiduUnitBot
from bot.chatgpt.chat_gpt_bot import ChatGPTBot
def create_bot(bot_type):
"""
@@ -13,7 +10,17 @@ def create_bot(bot_type):
:return: channel instance
"""
if bot_type == 'baidu':
# Baidu Unit对话接口
from bot.baidu.baidu_unit_bot import BaiduUnitBot
return BaiduUnitBot()
elif bot_type == 'chatGPT':
# ChatGPT 网页端web接口
from bot.chatgpt.chat_gpt_bot import ChatGPTBot
return ChatGPTBot()
elif bot_type == 'openAI':
# OpenAI 官方对话模型API
from bot.openai.open_ai_bot import OpenAIBot
return OpenAIBot()
raise RuntimeError