{"id":13562250,"url":"https://github.com/liyupi/yu-auto-reply","last_synced_at":"2025-12-25T07:11:40.945Z","repository":{"id":147780952,"uuid":"618470120","full_name":"liyupi/yu-auto-reply","owner":"liyupi","description":"AI 自动回复工具，支持灵活配置多个平台的监控和回答。目前已支持知识星球自动回复、OpenAI（ChatGPT）自动回答","archived":false,"fork":false,"pushed_at":"2023-03-27T02:34:09.000Z","size":768,"stargazers_count":857,"open_issues_count":11,"forks_count":364,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-03T18:41:29.435Z","etag":null,"topics":["ai","chatgpt","java","openai","springboot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liyupi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-03-24T14:36:19.000Z","updated_at":"2025-03-27T09:21:38.000Z","dependencies_parsed_at":"2023-05-03T03:01:01.454Z","dependency_job_id":null,"html_url":"https://github.com/liyupi/yu-auto-reply","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/liyupi/yu-auto-reply","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liyupi%2Fyu-auto-reply","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liyupi%2Fyu-auto-reply/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liyupi%2Fyu-auto-reply/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liyupi%2Fyu-auto-reply/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liyupi","download_url":"https://codeload.github.com/liyupi/yu-auto-reply/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liyupi%2Fyu-auto-reply/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28022941,"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","status":"online","status_checked_at":"2025-12-25T02:00:05.988Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ai","chatgpt","java","openai","springboot"],"created_at":"2024-08-01T13:01:06.267Z","updated_at":"2025-12-25T07:11:40.917Z","avatar_url":"https://github.com/liyupi.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"# yu-auto-reply 自动回复\n\n\u003e 作者：[程序员鱼皮](https://github.com/liyupi)\n\u003e \n\u003e 编程学习圈：[编程导航知识星球](https://yupi.icu)\n\n[toc]\n\n基于 Java Spring Boot 的平台监控及自动回复工具，支持灵活地配置多个监控任务，支持一键部署！\n\n演示视频：https://www.bilibili.com/video/BV1WX4y1o7aL\n\n![](doc/演示.png)\n\n本项目采用多种设计模式，解耦监控者及回答者，可以灵活配置多个不同平台的监控，并绑定不同类型的自动回复。\n\n🙏🏻 大家喜欢这个项目的话，感谢动手点点 star，后面作者可能会官方提供更多的平台监控支持。\n\n## 功能特性\n\n### 监控能力\n\n- 知识星球提问监控\n- 默认监控（模拟数据）\n\n### 回复能力\n\n- OpenAI 回答（支持自选模型，比如 gpt-4）\n- 默认监控（模拟数据）\n\n### 配置能力\n\n- 支持配置多个任务\n- 每个任务可以灵活指定监控和回答方式\n\n### 部署能力\n\n- 支持 Docker 容器化部署\n- 支持 Railway 一键部署\n- 支持动态指定环境变量来改变配置\n\n## 快速启动\n\n1）修改 `application.yml` 配置，主要包含 3 部分：\n\n- openAI 配置（需要有一个 API Key）\n- 知识星球配置（需要自行获取 cookie）\n- 任务配置\n\n详细配置如下：\n\n```yml\n# openAI 配置\n# https://platform.openai.com/docs/api-reference\nopenai:\n  model: ${OPENAI_MODEL:text-davinci-003}\n  apiKey: ${OPENAI_API_KEY:你的apiKey}\n# 知识星球配置\n# https://zsxq.com/\nzsxq:\n  cookie: ${ZSXQ_COOKIE:你的星球cookie}\n  groupId: ${ZSXQ_GROUP_ID:你的星球id}\n  # 是否提醒提问者\n  silenced: ${ZSXQ_SILENCED:true}\n# 任务配置\ntask:\n  # 任务列表，支持配置多个\n  list:\n    - name: task1 #任务名\n      monitor: zsxq #监控者\n      answerer: openai #回答者\n      cron: '0/30 * * * * ?' #执行周期\n```\n\n2）直接运行主类 `MainApplication` 即可\n\n## 一键部署\n\n[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/BMJMMm?referralCode=tKgj86)\n\n点击上述部署按钮后，会自动识别环境变量，改成自己的就可以了：\n\n![](doc/env.png)\n\n## 架构设计\n\n一图胜千言：\n\n![](doc/架构.png)\n\n本项目最关键的设计就是在于 **解耦监控者与回答者** ，你可以监控任何平台，并且给每个平台绑定不同的自动回答（比如 OpenAI）。\n\n实现关键：\n\n1. 定义 Answerer 回答者接口，统一回答的方法\n2. 定义 Monitor 监控者接口，统一监控的方法，通过 Answerer 回调参数实现对监控到的消息进行自动回复\n3. 使用中介者模式，用 JobMediator 类组合 Monitor 和 Answerer，而不是把回答者和监控者强绑定\n4. 使用工厂模式，根据配置生成监控者和回答者\n5. 使用 Spring Scheduler，读取 yml 配置来自动创建多任务\n\n## 开发\n\n### 自定义监控\n\n1）编写一个类，实现 `monitor/Monitor` 抽象类\n\n2）修改 `factory/MonitorFactory` 的 `createMonitor` 方法，补充创建你自己的监控者\n\n### 自定义回答\n\n1）编写一个类，实现 `answerer/Answerer` 接口\n\n2）修改 `factory/AnswererFactory` 的 `createAnswerer` 方法，补充创建你自己的回答者\n\n\n## 免费 ChatGPT 交流群\n\n![](doc/ChatGPT交流.png)\n\n\n## 欢迎贡献\n\n**作者平时非常忙** ，本项目也是仅用了几个小时抽空做的，开源出来给大家参考，但是 PR 和 Issues 响应不会很及时，感谢理解！\n\n如有项目本身的问题，欢迎提 issues 和 PR；\n\n如有编程方面的问题、或者需要项目教学，请看 [编程导航知识星球](https://yupi.icu)\n\n\n## 问答\n\n1）问：为什么先支持知识星球？\n\n答：因为 OpenAI 的 API 不是免费的，星球可以限制提问次数，防止刷接口\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliyupi%2Fyu-auto-reply","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliyupi%2Fyu-auto-reply","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliyupi%2Fyu-auto-reply/lists"}