From 6bd1242d43a77f2afbde5468f4d78c0a3cb0c915 Mon Sep 17 00:00:00 2001 From: lanvent Date: Sun, 9 Apr 2023 16:16:54 +0800 Subject: [PATCH] chore: update requirements and config-template --- bridge/bridge.py | 2 +- channel/wechat/wechat_channel.py | 2 ++ config-template.json | 1 - requirements-optional.txt | 2 +- requirements.txt | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bridge/bridge.py b/bridge/bridge.py index 5c8448e..a19fc83 100644 --- a/bridge/bridge.py +++ b/bridge/bridge.py @@ -19,7 +19,7 @@ class Bridge(object): model_type = conf().get("model") if model_type in ["text-davinci-003"]: self.btype['chat'] = const.OPEN_AI - if conf().get("use_azure_chatgpt"): + if conf().get("use_azure_chatgpt", False): self.btype['chat'] = const.CHATGPTONAZURE self.bots={} diff --git a/channel/wechat/wechat_channel.py b/channel/wechat/wechat_channel.py index 36f6157..b11611d 100644 --- a/channel/wechat/wechat_channel.py +++ b/channel/wechat/wechat_channel.py @@ -147,6 +147,8 @@ class WechatChannel(ChatChannel): if conf().get('speech_recognition') != True: return logger.debug("[WX]receive voice for group msg: {}".format(cmsg.content)) + elif cmsg.ctype == ContextType.IMAGE: + logger.debug("[WX]receive image for group msg: {}".format(cmsg.content)) else: # logger.debug("[WX]receive group msg: {}, cmsg={}".format(json.dumps(cmsg._rawmsg, ensure_ascii=False), cmsg)) pass diff --git a/config-template.json b/config-template.json index abb3486..528bd60 100644 --- a/config-template.json +++ b/config-template.json @@ -2,7 +2,6 @@ "open_ai_api_key": "YOUR API KEY", "model": "gpt-3.5-turbo", "proxy": "", - "use_azure_chatgpt": false, "single_chat_prefix": ["bot", "@bot"], "single_chat_reply_prefix": "[bot] ", "group_chat_prefix": ["@bot"], diff --git a/requirements-optional.txt b/requirements-optional.txt index 55e3f7a..949a1dc 100644 --- a/requirements-optional.txt +++ b/requirements-optional.txt @@ -21,4 +21,4 @@ web.py # chatgpt-tool-hub plugin --extra-index-url https://pypi.python.org/simple -chatgpt_tool_hub>=0.3.5 \ No newline at end of file +chatgpt_tool_hub>=0.3.7 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 75ff7fb..61f979d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -openai>=0.27.2 +openai==0.27.2 HTMLParser>=0.0.2 PyQRCode>=1.2.1 qrcode>=7.4.2