mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-02-26 07:56:34 +08:00
update
This commit is contained in:
@@ -33,8 +33,7 @@ class ChatGPTBot(Bot, OpenAIImage):
|
||||
conf_model = conf().get("model") or "gpt-3.5-turbo"
|
||||
self.sessions = SessionManager(ChatGPTSession, model=conf().get("model") or "gpt-3.5-turbo")
|
||||
# o1相关模型不支持system prompt,暂时用文心模型的session
|
||||
if conf_model == const.O1 or const.O1_MINI:
|
||||
self.sessions = SessionManager(BaiduWenxinSession, model=conf().get("model") or const.O1_MINI)
|
||||
|
||||
self.args = {
|
||||
"model": conf_model, # 对话模型的名称
|
||||
"temperature": conf().get("temperature", 0.9), # 值在[0,1]之间,越大表示回复越具有不确定性
|
||||
@@ -46,7 +45,8 @@ class ChatGPTBot(Bot, OpenAIImage):
|
||||
"timeout": conf().get("request_timeout", None), # 重试超时时间,在这个时间内,将会自动重试
|
||||
}
|
||||
# o1相关模型固定了部分参数,暂时去掉
|
||||
if conf_model == const.O1 or const.O1_MINI:
|
||||
if conf_model in [const.O1, const.O1_MINI]:
|
||||
self.sessions = SessionManager(BaiduWenxinSession, model=conf().get("model") or const.O1_MINI)
|
||||
remove_keys = ["temperature", "top_p", "frequency_penalty", "presence_penalty"]
|
||||
for key in remove_keys:
|
||||
self.args.pop(key, None) # 如果键不存在,使用 None 来避免抛出错误
|
||||
|
||||
Reference in New Issue
Block a user