Sfoglia il codice sorgente

docs: use the latest version of openai

zhayujie 3 anni fa
parent
commit
8b2a9ee130
2 ha cambiato i file con 6 aggiunte e 4 eliminazioni
  1. 1 0
      .gitignore
  2. 5 4
      README.md

+ 1 - 0
.gitignore

@@ -4,3 +4,4 @@ __pycache__/
 venv*
 *.pyc
 config.json
+QR.png

+ 5 - 4
README.md

@@ -62,8 +62,9 @@ cd chatgpt-on-wechat/
 
 ```bash
 pip3 install itchat-uos==1.5.0.dev0
-pip3 install openai==0.25.0
+pip3 install --upgrade openai
 ```
+注:`itchat-uos`使用指定版本1.5.0.dev0,`openai`使用最新版本,需高于0.25.0。
 
 
 ## 配置
@@ -89,17 +90,17 @@ cp config-template.json config.json
 ```
 **配置说明:**
 
-**个人聊天**
+**1.个人聊天**
 
 + 个人聊天中,需要以 "bot"或"@bot" 为开头的内容触发机器人,对应配置项 `single_chat_prefix` (如果不需要以前缀触发可以填写  `"single_chat_prefix": [""]`)
 + 机器人回复的内容会以 "[bot] " 作为前缀, 以区分真人,对应的配置项为 `single_chat_reply_prefix` (如果不需要前缀可以填写 `"single_chat_reply_prefix": ""`)
 
-**群组聊天**
+**2.群组聊天**
 
 + 群组聊天中,群名称需配置在 `group_name_white_list ` 中才能开启群聊自动回复。如果想对所有群聊生效,可以直接填写 `"group_name_white_list": "ALL_GROUP"`
 + 默认只要被人 @ 就会触发机器人自动回复;另外群聊天中只要检测到以 "@bot" 开头的内容,同样会自动回复(方便自己触发),这对应配置项 `group_chat_prefix`
 
-**其他配置**
+**3.其他配置**
 
 + 对于图像生成,在满足个人或群组触发条件外,还需要额外的关键词前缀来触发,对应配置 `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` 中进行调整。