From 3ef7855384852d6733bd9af0e370a23d1a056568 Mon Sep 17 00:00:00 2001 From: lichengzhe <38408577@qq.com> Date: Sun, 19 Mar 2023 08:29:25 +0800 Subject: [PATCH] =?UTF-8?q?itchat=E5=A2=9E=E5=8A=A0hot=5Freload=E7=89=B9?= =?UTF-8?q?=E6=80=A7=E5=BC=80=E5=85=B3=EF=BC=8C=E9=BB=98=E8=AE=A4=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E3=80=82=E9=85=8D=E7=BD=AE=E6=96=87=E6=A1=A3=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=8F=AF=E9=80=89=E5=8F=82=E6=95=B0=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +++ channel/wechat/wechat_channel.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 00ef3d3..5d35975 100644 --- a/README.md +++ b/README.md @@ -129,10 +129,13 @@ pip3 install --upgrade openai **4.其他配置** + `model`: 模型名称,目前支持 `gpt-3.5-turbo`, `text-davinci-003`, `gpt-4`, `gpt-4-32k` (其中gpt-4 api暂未开放) ++ `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 ` + 关于OpenAI对话及图片接口的参数配置(内容自由度、回复字数限制、图片大小等),可以参考 [对话接口](https://beta.openai.com/docs/api-reference/completions) 和 [图像接口](https://beta.openai.com/docs/api-reference/completions) 文档直接在 [代码](https://github.com/zhayujie/chatgpt-on-wechat/blob/master/bot/openai/open_ai_bot.py) `bot/openai/open_ai_bot.py` 中进行调整。 + `conversation_max_tokens`:表示能够记忆的上下文最大字数(一问一答为一组对话,如果累积的对话字数超出限制,就会优先移除最早的一组对话) ++ `clear_memory_commands`: 对话内指令,主动清空前文记忆,字符串数组可自定义指令别名。 ++ `hot_reload`: 程序退出后,暂存微信扫码状态,默认关闭。 + `character_desc` 配置中保存着你对机器人说的一段话,他会记住这段话并作为他的设定,你可以为他定制任何人格 (关于会话上下文的更多内容参考该 [issue](https://github.com/zhayujie/chatgpt-on-wechat/issues/43)) diff --git a/channel/wechat/wechat_channel.py b/channel/wechat/wechat_channel.py index d43a0a3..5a06227 100644 --- a/channel/wechat/wechat_channel.py +++ b/channel/wechat/wechat_channel.py @@ -42,7 +42,7 @@ class WechatChannel(Channel): def startup(self): # login by scan QRCode - itchat.auto_login(enableCmdQR=2) + itchat.auto_login(enableCmdQR=2, hotReload=conf().get('hot_reload', False)) # start message listener itchat.run()