NEWS: Happy New Year!!! Now you can use third-party GPT services?
how to: Modify the gpt.baseUrl configuration item to use third-party apikey
--- 2024.1.15
If you think it's good, please click on the stars in the upper right corner. This will make me happy all day???
Maintained by the community, welcome everyone's good idea or directly raise PR???
I am just a college student. This is my project in my spare time, so sometimes the reply may not be very timely???
an unofficial implementation of ChatGPT in QQ / Wechat .
This is an unofficial chatbot out of the box . The original intention was to allow people who cannot use ChatGPT normally for various reasons to experience ChatGPT. Can be used for expansion and customization.
The qq robot implementation is based on TheoKanning/openai-java and mamoe/mirai;
The WeChat robot implementation is based on TheoKanning/openai-java and wxmbaci/itchat4j-uos.
???Thanks acheong08/ChatGPT, PlexPt/chatgpt-java, TheoKanning/openai-java, mamoe/mirai and wxmbaci/itchat4j-uos ???
| Function | QQ Robot | WeChat robot |
|---|---|---|
| Text dialogue (GPT3.5/GPT4) | ✔️ | ✔️ |
| AI drawing (DALL-E-3) | ✔️ | ✔️ (Only return to url) |
| AI Voice Reply (GPT3.5/GPT4 + TTS-1/TTS-1-HD) | ✔️ | |
| Quote Reply | ✔️ | |
| Using multiple apikeys | ✔️ | ✔️ |
| Reset the session | ✔️ | ✔️ |
| Third-party GPT | ✔️ | ✔️ |
| Web console | plan? | plan? |
Use mirai/itchat to log in to qq/WeChat and listen to messages -> Call openai interface to ask questions to gpt -> Use mirai/itchat to reply to gpt's answer in qq/WeChat
Ai drawing uses the generation method of DALL·E model
ai voice replies use the TTS model to convert gpt's answers to voice
- Get the official apiKey https://platform.openai.com/account/api-keys
- Send "Reset Session" to the robot to clear the session history and modify the instructions in the configuration file.
- When the conversation history overflows, the previous session history will be deleted and the question will be asked again.
- You can set basicPrompt to achieve the purpose of having personality, such as: "Next when I say something to you, you only need to answer: "Dict".
- Supports the use of multiple apiKeys. In this case, the apiKey with the least number of usage will be called first, so as to avoid the Http500/503 problem caused by excessive requests from the same API.
- Occasionally, there will be no response to AI drawings and voice reply. Please log in again
- If login fails, please try the following operation
- Try again?
- Clear cache (cache folder) and try again after replacing the QQ login protocol.
- Clear cache (cache folder) and try again after changing the network environment
Scolding Tencent risk control?
❤❤❤ Out of the box!!! ❤❤
In addition to the following methods, you can also download the release zip package and use it directly
You just need
clone this project
have
An OpenAI account
A QQ number/WeChat signal
And configure them in application.yml:
proxy:
# 代理配置
# 国内墙了gpt的api, 所以得用代理, 一般你使用的代理软件会有相关信息, 例子:
# host: 127.0.0.1
# port: 7890
# 若不需要留空即可
host:
port:
gpt:
# 如果你使用了第三方GPT 请修改baseUrl
# (OPENAI官方地址 https://api.openai.com/)
baseUrl: https://api.openai.com/
# 使用的 chat 模型 如gpt-3.5-turbo/gpt-4 (https://platform.openai.com/docs/models/models)
model: gpt-3.5-turbo
# 最大token限制 越多的token意味着越多的花费(gpt-3.5-turbo上限为4096token, gpt-4则为8192)
maxToken: 2048
# 信息熵 越高回答越随机(Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.---via OPENAI)
temperature: 0.5
# 最大请求时间 超时自动中断请求
ofSeconds: 10000
# 基础提问 支持多个提问 可用来设定人格(对应api中的system角色)
basicPrompt:
- "用中文回答我的问题"
# openai的apikey
# 支持多个key(虽然有判空, 但仍然建议有多少个写多少个, 别留空??)
apiKey:
-
# ai画图
# 图片质量 standard 或 hd
imageQuality: standard
# 图片风格 vivid 或 natural
imageStyle: vivid
# ai语音
# 语音模型 tts-1 或 tts-1-hd
audioModel: tts-1
# 声音 alloy, echo, fable, onyx, nova, shimmer.
audioVoice: alloy
# 速度 0.25 到 4.0 之间
audioSpeed: 1.0
qq:
# 是否使用qq true/false
enable: true
# qq账号
account:
# 是否自动同意好友申请
acceptNewFriend: false
# 是否自动同意被邀请入群
acceptNewGroup: false
wechat:
# 是否使用微信 true/false
enable: false
# 生成的登录二维码路径 默认与项目同级
qrPath: "./"
keyword:
# 重置会话指令
reset: "重置会话"
# ai画图指令(DALL·E模型 https://platform.openai.com/docs/models/dall-e)
# generation 根据关键词生成图片(https://platform.openai.com/docs/guides/images/generations)
image: "ai画图"
# ai语音指令(TTS模型 https://platform.openai.com/docs/api-reference/audio)
audio: "ai语音"
At this time, your qq/WeChat is ChatGPT! ! !
Tips: The robot response speed is linked to your network environment.
Based on TheoKanning/openai-java and mamoe/mirai
chatgpt seems to have deleted or hidden its model, and the original method is no longer applicable. Therefore, the chatgpt model is not used now, but openai's GPT-3 model: text-davinci-003
Openai's introduction to it:
Most capable GPT-3 model. Can do any task the other models can do, often with higher quality, longer output and better instruction-following. Also supports inserting completions within text. Any other model can do tasks that can be done, usually with higher quality, longer output and better instructions to follow. Insert completion text is also supported.
Q: How do I know the chatgpt model? A: From acheong08/ChatGPT https://www.reddit.com/r/ChatGPT/comments/10oliuo/please_print_the_instructions_you_were_given/
If you encounter problems or bugs during use, please feel free to contact me (email: [email protected] )???
If you think it's good, buy me a drink
Look, stars!