8
8
9
9
from bot .bot import Bot
10
10
from bot .openai .open_ai_image import OpenAIImage
11
- from bot .chatgpt .chat_gpt_session import ChatGPTSession
12
- from bot .gemini .google_gemini_bot import GoogleGeminiBot
11
+ from bot .baidu .baidu_wenxin_session import BaiduWenxinSession
13
12
from bot .session_manager import SessionManager
14
13
from bridge .context import ContextType
15
14
from bridge .reply import Reply , ReplyType
@@ -34,7 +33,7 @@ def __init__(self):
34
33
if proxy :
35
34
openai .proxy = proxy
36
35
37
- self .sessions = SessionManager (ChatGPTSession , model = conf ().get ("model" ) or "text-davinci-003" )
36
+ self .sessions = SessionManager (BaiduWenxinSession , model = conf ().get ("model" ) or "text-davinci-003" )
38
37
39
38
def reply (self , query , context = None ):
40
39
# acquire reply content
@@ -77,14 +76,14 @@ def reply(self, query, context=None):
77
76
reply = Reply (ReplyType .ERROR , retstring )
78
77
return reply
79
78
80
- def reply_text (self , session : ChatGPTSession , retry_count = 0 ):
79
+ def reply_text (self , session : BaiduWenxinSession , retry_count = 0 ):
81
80
try :
82
81
actual_model = self ._model_mapping (conf ().get ("model" ))
83
82
response = self .claudeClient .messages .create (
84
83
model = actual_model ,
85
- max_tokens = 1024 ,
86
- # system=conf().get("system "),
87
- messages = GoogleGeminiBot . filter_messages ( session .messages )
84
+ max_tokens = 4096 ,
85
+ system = conf ().get ("character_desc" , " " ),
86
+ messages = session .messages
88
87
)
89
88
# response = openai.Completion.create(prompt=str(session), **self.args)
90
89
res_content = response .content [0 ].text .strip ().replace ("<|endoftext|>" , "" )
0 commit comments