diff --git a/README.md b/README.md index 5f73eba..ee76b04 100644 --- a/README.md +++ b/README.md @@ -167,7 +167,7 @@ pip3 install -r requirements-optional.txt **4.其他配置** -+ `model`: 模型名称,目前支持 `gpt-3.5-turbo`, `gpt-4o`, `gpt-4-turbo`, `gpt-4`, `wenxin` , `claude` , `gemini`, `glm-4`, `xunfei`, `moonshot`等,全部模型名称参考`common/const.py`文件 ++ `model`: 模型名称,目前支持 `gpt-3.5-turbo`, `gpt-4o`, `gpt-4-turbo`, `gpt-4`, `wenxin` , `claude` , `gemini`, `glm-4`, `xunfei`, `moonshot`等,全部模型名称参考[common/const.py](https://github.com/zhayujie/chatgpt-on-wechat/blob/master/common/const.py)文件 + `temperature`,`frequency_penalty`,`presence_penalty`: Chat API接口参数,详情参考[OpenAI官方文档。](https://platform.openai.com/docs/api-reference/chat) + `proxy`:由于目前 `openai` 接口国内无法访问,需配置代理客户端的地址,详情参考 [#351](https://github.com/zhayujie/chatgpt-on-wechat/issues/351) + 对于图像生成,在满足个人或群组触发条件外,还需要额外的关键词前缀来触发,对应配置 `image_create_prefix ` diff --git a/bot/baidu/baidu_wenxin.py b/bot/baidu/baidu_wenxin.py index 0e91668..ff78e75 100644 --- a/bot/baidu/baidu_wenxin.py +++ b/bot/baidu/baidu_wenxin.py @@ -18,11 +18,14 @@ class BaiduWenxinBot(Bot): def __init__(self): super().__init__() - wenxin_model = conf().get("baidu_wenxin_model") or "completions" - if conf().get("model") and conf().get("model") == const.WEN_XIN: - wenxin_model = "completions" - if conf().get("model") and conf().get("model") == const.WEN_XIN_4: - wenxin_model = "completions_pro" + wenxin_model = conf().get("baidu_wenxin_model") + if wenxin_model is not None: + wenxin_model = conf().get("baidu_wenxin_model") or "eb-instant" + else: + if conf().get("model") and conf().get("model") == const.WEN_XIN: + wenxin_model = "completions" + elif conf().get("model") and conf().get("model") == const.WEN_XIN_4: + wenxin_model = "completions_pro" self.sessions = SessionManager(BaiduWenxinSession, model=wenxin_model)