Skip to content

Commit 49446d4

Browse files
committed
feat: add wenxin 4.0 model
1 parent ced560e commit 49446d4

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

bot/baidu/baidu_wenxin.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ class BaiduWenxinBot(Bot):
1616

1717
def __init__(self):
1818
super().__init__()
19-
self.sessions = SessionManager(BaiduWenxinSession, model=conf().get("baidu_wenxin_model") or "eb-instant")
19+
wenxin_model = conf().get("baidu_wenxin_model") or "eb-instant"
20+
if conf().get("model") and conf().get("model") == "wenxin-4":
21+
wenxin_model = "completions_pro"
22+
self.sessions = SessionManager(BaiduWenxinSession, model=wenxin_model)
2023

2124
def reply(self, query, context=None):
2225
# acquire reply content

bridge/bridge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def __init__(self):
2323
self.btype["chat"] = const.OPEN_AI
2424
if conf().get("use_azure_chatgpt", False):
2525
self.btype["chat"] = const.CHATGPTONAZURE
26-
if model_type in ["wenxin"]:
26+
if model_type in ["wenxin", "wenxin-4"]:
2727
self.btype["chat"] = const.BAIDU
2828
if model_type in ["xunfei"]:
2929
self.btype["chat"] = const.XUNFEI

common/const.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
XUNFEI = "xunfei"
66
CHATGPTONAZURE = "chatGPTOnAzure"
77
LINKAI = "linkai"
8-
9-
VERSION = "1.3.0"
10-
118
CLAUDEAI = "claude"
12-
MODEL_LIST = ["gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-4", "wenxin", "xunfei","claude"]
9+
10+
MODEL_LIST = ["gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-4", "wenxin", "wenxin-4", "xunfei", "claude"]

0 commit comments

Comments
 (0)