Giter Site home page Giter Site logo

w5l6j9 / wechatgpt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from littlehui/wechatgpt

0.0 0.0 0.0 253 KB

为微信公众号接入ChatGPT。支持单用户限流,多用户私有OpenAiApiKey配置,聊天内容上下文关联,优化的被动回复消息。

Shell 0.02% Java 99.98%

wechatgpt's Introduction

项目介绍

接入ChatGPT 3.5的微信公众号助手。

关键实现技术

  1. Java,版本8
  2. Spring boot,版本:2.5.2
  3. Redis,版本4.XX
  4. chatGPT客户端:chatgpt-java,版本:1.0.10
  5. 微信公众号客户端:weixin-java-mp,版本:4.4.0

功能介绍

  1. 接入ChatGpt 3.5,通过互动二次确认问题的方式优化了只能被动推送消息的体验。
  2. 支持按照微信OpenID的限流,10秒钟4次。
  3. 未设置openAiApiKey前,每个OpenId限制1天试用5次。设置后无当天的使用次数限制。
  4. 支持上限文关联,建议最多3组上下文。
  5. 支持设置用户自己的openAiApi。在聊天窗口中输入:"/setApiKey xxxxxx",即可。

功能演示

  1. 正常问答 图片

如何使用

前置准备

  1. 公众号已申请。
  2. 在基本配置页面获取到 appId,秘钥,token,aesKey。
  3. 公众号权限开通接收消息权限。
  4. 可以访openAi的服务器,用来部署后端接口。 配置参考: 图片

配置注意点:

  1. 公众号配置服务器url,这里填写你部署的服务器url, /wechat 是接口名。
  2. 先部署接口,然后启用,启用微信会发送一个确认到 /wechat 接口。如果正常则启动成功。 图片

开始

  1. 修改 ./profiles/application-dev.properties配置添加redis和公众号相关配置
dev.app.redis.host=
dev.app.redis.port=
dev.app.redis.password=

dev.wx.mp.appId=
dev.wx.mp.secret=
dev.wx.mp.token=
dev.wx.mp.aesKey=
  1. 添加openAiApi配置
dev.app.config.openai.apikey=
  1. 编译
mvn clean package -DskipTests -T 4C

编译后在dzt-app-web项目的target包下有一个dzt-app-web.jar包。

  1. 启动
java -jar dzt-app-web.jar --spring.profiles.active=dev

试用效果

微信公众号搜索:"码农星人",并关注,即可试用。 或则扫描二维码: 图片

wechatgpt's People

Contributors

littlehui avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.