mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-20 21:57:14 +08:00
feat: add config for model selection #471
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from bot import bot_factory
|
||||
from voice import voice_factory
|
||||
from config import conf
|
||||
from common import const
|
||||
|
||||
|
||||
class Bridge(object):
|
||||
@@ -7,7 +9,13 @@ class Bridge(object):
|
||||
pass
|
||||
|
||||
def fetch_reply_content(self, query, context):
|
||||
return bot_factory.create_bot("chatGPT").reply(query, context)
|
||||
bot_type = const.CHATGPT
|
||||
model_type = conf().get("model")
|
||||
if model_type in ["gpt-3.5-turbo", "gpt-4", "gpt-4-32k"]:
|
||||
bot_type = const.CHATGPT
|
||||
elif model_type in ["text-davinci-003"]:
|
||||
bot_type = const.OPEN_AI
|
||||
return bot_factory.create_bot(bot_type).reply(query, context)
|
||||
|
||||
def fetch_voice_to_text(self, voiceFile):
|
||||
return voice_factory.create_voice("openai").voiceToText(voiceFile)
|
||||
|
||||
Reference in New Issue
Block a user