forked from zhayujie/bot-on-anything
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel_factory.py
36 lines (28 loc) · 919 Bytes
/
model_factory.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""
channel factory
"""
from common import const
def create_bot(model_type):
"""
create a channel instance
:param channel_type: channel type code
:return: channel instance
"""
if model_type == const.OPEN_AI:
# OpenAI 官方对话模型API (gpt-3.0)
from model.openai.open_ai_model import OpenAIModel
return OpenAIModel()
elif model_type == const.CHATGPT:
# ChatGPT API (gpt-3.5-turbo)
from model.openai.chatgpt_model import ChatGPTModel
return ChatGPTModel()
elif model_type == const.BAIDU:
from model.baidu.yiyan_model import YiyanModel
return YiyanModel()
elif model_type == const.BING:
from model.bing.new_bing_model import BingModel
return BingModel()
elif model_type == const.BARD:
from model.google.bard_model import BardModel
return BardModel()
raise RuntimeError