2 Star 0 Fork 0

jiangsonglin / ChatGPT

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

ChatGPT-wechat

微信公众号自动回复接入chatgpt开放AP,由于微信官方限制回复消息接口响应必须在5秒内,但是Chatgpt是境外请求,部署的服务没有CDN的情况延时较高,有可能回复不到微信公众号内。 采用缓存msgId方式,动态计算max_tokens,去除历史记录上下文。 需要配合Redis使用。

体验(公众号): 程序员多米

微信公众号版

在本JAVA项目中application.yml中配置上面chatgpt接口服务的接口url,以及公众号信息

api:
  chatgpt:
    url: https://api.openai.com/v1/chat/completions
    apikey: 你的key
spring:
  redis:
    database: 10
    host: 172.19.0.228
    port: 6379
wx:
  mp:
    useRedis: false
    redisConfig:
      host: 127.0.0.1
      port: 6379
      password:
    configs:
      - appId: xxx # 第一个公众号的appid
        secret: xxx # 公众号的appsecret
        token: xxx # 接口配置里的Token值
        aesKey: xxx # 接口配置里的EncodingAESKey值

公众号配置相关问题

  1. 登陆微信公众平台https://mp.weixin.qq.com

  2. 在菜单[设置与开发]-[基本配置]的服务器配置中预先填好token跟aesKey

  3. 在本项目的yml中配置好这些信息先部署到服务器上,验证本项目部署在服务器上的http://xxx.xxx.xxx.x/wx/portal/{appId} 接口能正常返回时后再填写到[服务器配置]的url输入框提交。

  4. 消息加解密方式可以先选明文模式,有需要自己再改。

演示效果

演示图

MIT License Copyright (c) 2023 chengjiaxiongkf Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

🔥🔥 chatgpt对接微信公众号,解决微信接收不了消息,token计算问题 展开 收起
Java 等 2 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/jiangsonglin/ChatGPT.git
git@gitee.com:jiangsonglin/ChatGPT.git
jiangsonglin
ChatGPT
ChatGPT
master

搜索帮助