{"id":19075219,"url":"https://github.com/martindai/wechatrobot","last_synced_at":"2025-05-16T15:06:36.551Z","repository":{"id":33477572,"uuid":"37123269","full_name":"MartinDai/weChatRobot","owner":"MartinDai","description":"一个基于微信公众号的智能聊天机器人项目，支持根据关键字或者调用OpenAI、通义千问等大语言模型服务回复内容","archived":false,"fork":false,"pushed_at":"2025-02-13T12:33:03.000Z","size":252,"stargazers_count":218,"open_issues_count":1,"forks_count":100,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-04-12T14:16:05.219Z","etag":null,"topics":["java","vertx-web","wechat"],"latest_commit_sha":null,"homepage":"https://wechatrobot.doodl6.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MartinDai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-06-09T09:35:39.000Z","updated_at":"2025-04-07T03:30:39.000Z","dependencies_parsed_at":"2024-02-03T07:32:08.343Z","dependency_job_id":"2dc53700-b7a5-4038-b092-9474e6eef179","html_url":"https://github.com/MartinDai/weChatRobot","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinDai%2FweChatRobot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinDai%2FweChatRobot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinDai%2FweChatRobot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinDai%2FweChatRobot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MartinDai","download_url":"https://codeload.github.com/MartinDai/weChatRobot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254553959,"owners_count":22090417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","vertx-web","wechat"],"created_at":"2024-11-09T01:53:55.587Z","updated_at":"2025-05-16T15:06:36.520Z","avatar_url":"https://github.com/MartinDai.png","language":"Java","readme":"# weChatRobot\n\n一个基于微信公众号的智能聊天机器人项目，支持根据关键字或者调用OpenAI、通义千问等大语言模型服务回复内容。\n\n[![Release](https://img.shields.io/github/v/release/martindai/wechatRobot?color=369eff\u0026labelColor=black\u0026logo=github\u0026style=flat-square)](https://github.com/martindai/wechatRobot/releases)\n[![License](https://img.shields.io/github/license/martindai/wechatRobot)](LICENSE)\n\n本项目还有Go实现的版本：\u003chttps://github.com/MartinDai/weChatRobot-go\u003e\n\n![qrcode](robot-web/src/main/resources/static/images/qrcode.jpg \"扫码关注，体验智能机器人\")\n\n## 项目介绍：\n\n本项目是一个微信公众号项目，需配合微信公众号使用，在微信公众号配置本项目运行的服务器域名，用户关注公众号后，向公众号发送任意信息，公众号会根据用户发送的内容自动回复。\n  \n## 涉及框架及技术\n\n- [Vert.x](https://github.com/eclipse-vertx/vert.x)\n- [Jackson](https://github.com/FasterXML/jackson)\n- [OkHttp](https://github.com/square/okhttp)\n- [Guava](https://github.com/google/guava)\n- [Openai-java](https://github.com/TheoKanning/openai-java)\n\n_Tips:1.2版本开始使用Vert.x替换SpringBoot_\n\n## 支持的功能\n\n+ [x] 自定义关键字回复内容\n+ [x] 调用OpenAI接口回复内容（配置启动参数或者环境变量：`OPENAI_API_KEY`）\n+ [x] 修改OpenAI的接口地址（配置启动参数或者环境变量：`OPENAI_SERVER_URL`）\n+ [x] 调用通义千问接口回复内容（配置启动参数或者环境变量：`DASHSCOPE_API_KEY`）\n+ [x] 调用图灵机器人(V2)接口回复内容（配置启动参数或者环境变量：`TULING_API_KEY`）\n\n## 使用说明\n\n需要有微信公众号的帐号，没有的请戳[微信公众号申请](https://mp.weixin.qq.com/cgi-bin/readtemplate?t=register/step1_tmpl\u0026lang=zh_CN)\n\n内容响应来源的优先级`自定义关键字 \u003e OpenAI \u003e 通义千问 \u003e 图灵机器人`\n\n在微信公众号后台配置回调URL为\u003chttps://\u003cyour.domain\u003e/weChat/receiveMessage\u003e，其中`\u003cyour.domain\u003e`替换成你自己的域名，token与`config.yml`里面配置的保持一致即可\n\n### OpenAI\n\n1. 如果需要使用OpenAI的回复内容则需要[创建OpenAI的API Key](https://platform.openai.com/account/api-keys)并配置在启动参数或者环境变量中\n2. 可以通过配置启动参数或者环境变量`OPENAI_SERVER_URL`指定访问OpenAI服务的baseUrl\n3. 可以通过配置启动参数或者环境变量`OPENAI_BASE_DOMAIN`更换访问OpenAI的域名(优先级低于`OPENAI_SERVER_URL`)\n4. 可以通过配置启动参数或者环境变量`OPENAI_PROXY`使用代理服务访问OpenAI\n\n### 通义千问\n\n如果需要使用通义千问的回复内容则需要[创建通义千问的API Key](https://bailian.console.aliyun.com/#/api_key)并配置在启动参数或者环境变量中\n\n### 图灵机器人\n\n如果需要使用图灵机器人的回复内容则需要[注册图灵机器人帐号](http://tuling123.com/register/email.jhtml)获取相应的ApiKey并配置在启动参数或者环境变量中\n\n## 开发部署\n\n### 本地启动\n\n直接运行类`com.doodl6.wechatrobot.MainVerticle`\n\n### jar包运行\n\nmaven编译打包\n\n```shell\nmvn clean package\n```\n\n打包完成后，在robot-web/target目录会生成weChatRobot.jar\n\n启动执行\n\n```shell\njava -jar weChatRobot.jar\n```\n\n使用-D指定配置文件，支持相对路径和绝对路径\n\n```shell\njava -Dconfig=config-deploy.yml -jar weChatRobot.jar\n```\n\n服务器部署后台运行\n\n```shell\nnohup java -jar weChatRobot.jar \u003e ./console.log 2\u003e\u00261 \u0026\n```\n\n在执行命令的当前目录查看console日志\n\n### Docker运行\n\n构建适用于当前操作系统架构的镜像\n\n```shell\ndocker build -f docker/Dockerfile --no-cache -t wechatrobot:latest .\n```\n\n构建指定架构的镜像\n\n```shell\ndocker buildx build -f docker/Dockerfile --no-cache -t wechatrobot:latest --platform=linux/amd64 -o type=docker .\n```\n\n后台运行镜像\n\n```shell\ndocker run --name wechatrobot -p 8080:8080 -d wechatrobot:latest\n```\n\n## 感谢赞助\n\n[\u003cimg src=\"https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg\" width=\"140\" height=\"140\" alt=\"jetbrains\"/\u003e](https://www.jetbrains.com/community/opensource/#support)\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=MartinDai/weChatRobot\u0026type=Date)](https://star-history.com/#MartinDai/weChatRobot\u0026Date)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartindai%2Fwechatrobot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartindai%2Fwechatrobot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartindai%2Fwechatrobot/lists"}