{"id":19451720,"url":"https://github.com/zhengxs2018/wechaty-plugin-assistant","last_synced_at":"2026-04-01T17:18:58.358Z","repository":{"id":207570759,"uuid":"719473587","full_name":"zhengxs2018/wechaty-plugin-assistant","owner":"zhengxs2018","description":"使用 wechaty 开发的聊天助手插件，内置多种AI大模型，只需三步即可轻松创建一个智能对话机器人","archived":false,"fork":false,"pushed_at":"2024-06-17T08:03:23.000Z","size":1453,"stargazers_count":45,"open_issues_count":0,"forks_count":6,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-28T00:37:04.801Z","etag":null,"topics":["ai","assistant","chatbot","chatgpt","claude","erniebot","llm","qwen","wechaty","wechaty-plugin"],"latest_commit_sha":null,"homepage":"https://tsdocs.dev/docs/@zhengxs/wechaty-plugin-assistant","language":"TypeScript","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/zhengxs2018.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-11-16T08:42:31.000Z","updated_at":"2025-12-15T00:21:17.000Z","dependencies_parsed_at":"2024-06-17T09:29:38.751Z","dependency_job_id":"f0198b4e-ad8a-4cbc-9a2f-fd380c3467d9","html_url":"https://github.com/zhengxs2018/wechaty-plugin-assistant","commit_stats":null,"previous_names":["zhengxs2018/wechaty-plugin-assistant"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/zhengxs2018/wechaty-plugin-assistant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhengxs2018%2Fwechaty-plugin-assistant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhengxs2018%2Fwechaty-plugin-assistant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhengxs2018%2Fwechaty-plugin-assistant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhengxs2018%2Fwechaty-plugin-assistant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhengxs2018","download_url":"https://codeload.github.com/zhengxs2018/wechaty-plugin-assistant/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhengxs2018%2Fwechaty-plugin-assistant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","assistant","chatbot","chatgpt","claude","erniebot","llm","qwen","wechaty","wechaty-plugin"],"created_at":"2024-11-10T16:42:44.938Z","updated_at":"2026-04-01T17:18:58.335Z","avatar_url":"https://github.com/zhengxs2018.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n  \n\u003ch1\u003e微信智能对话机器人\u003c/h1\u003e\n\n使用 wechaty 开发的聊天助手插件，内置多种AI大模型，只需三步即可轻松创建一个智能对话机器人\n\n[![][npm-types-shield]][npm-types-link]\n[![][npm-release-shield]][npm-release-link]\n[![][npm-downloads-shield]][npm-downloads-link]\n[![][github-releasedate-shield]][github-releasedate-link]\n[![Powered by Wechaty](https://img.shields.io/badge/Powered%20By-Wechaty-brightgreen.svg?labelColor=black\u0026style=flat-square)](https://wechaty.js.org)\u003cbr/\u003e\n[![][github-contributors-shield]][github-contributors-link]\n[![][github-forks-shield]][github-forks-link]\n[![][github-stars-shield]][github-stars-link]\n[![][github-issues-shield]][github-issues-link]\n[![][github-license-shield]][github-license-link]\n\n[Report Bug][github-issues-link] · [Request Feature][github-issues-link]\n\n![](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)\n\n\u003c/div\u003e\n\n\u003e [!WARNING]\n\u003e 发现使用 `Node 20`，在服务器启动会报一堆的 `AssertError` 错误，使用 `Node 18` 较为稳定。\n\u003e `AssertError` 错误后，可能出现 **自动重试**，导致可能的 **重复消息** 或 **自动退出**，原因未知\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ckbd\u003e目录树\u003c/kbd\u003e\u003c/summary\u003e\n\n#### TOC\n\n- [✨ 功能特性](#-功能特性)\n- [📖 使用文档](#-使用文档)\n- [📦 安装](#-安装)\n- [🧰 内置功能](#-内置功能)\n- [🪢 AI 模型](#-ai-模型)\n- [🔗 更多工具](#-更多工具)\n- [🤝 参与贡献](#-参与贡献)\n\n\u003cbr/\u003e\n\n\u003c/details\u003e\n\n## ✨ 功能特性\n\n- 🚀 **快速开始**: 只需简单三步，即可轻松启动智能对话机器人。\n- 💡 **关注点分离**: 通过抽象 **助手**、**上下文** 和 **大模型** 的概念，更方便地理解和应用，以应对复杂的对话场景。\n- 💬 **用户对话**: 专注于处理用户私聊和群内被提及的消息，避免大模型被大量消息阻塞。\n- ⏳ **处理等待**: 如果 AI 尚未回应，自动拒绝新消息的处理，确保对话流畅。\n- 🪡 **自由定制**: 考虑到二次开发的需求，可以方便地拓展助手功能，满足个性化需求。\n\n## 📖 使用文档\n\n**教程**\n\n- [一、概念](./docs/concepts.md)\n- [二、消息流程处理](./docs/process.md)\n- [三、自定义开发](./docs/tutorials.md)\n\n**文章**\n\n- [构建一个属于你自己的 AI 对话机器人](./docs/blog/build-your-ai-assistant.md.md)\n\n\u003cdiv align=\"right\"\u003e\n\n[![][back-to-top]](#readme-top)\n\n\u003c/div\u003e\n\n## 📦 安装\n\n要安装 `@zhengxs/wechaty-plugin-assistant`，请运行以下命令:\n\n```bash\n$ pnpm install @zhengxs/wechaty-plugin-assistant\n```\n\n\u003cdiv align=\"right\"\u003e\n\n[![][back-to-top]](#readme-top)\n\n\u003c/div\u003e\n\n## 👋 使用\n\n在这里获取你的 [accessToken](https://aistudio.baidu.com/index/accessToken) 值。\n\n```ts\nimport {\n  ChatERNIEBot,\n  createAssistant,\n} from '@zhengxs/wechaty-plugin-assistant';\nimport { WechatyBuilder } from 'wechaty';\nimport { QRCodeTerminal } from 'wechaty-plugin-contrib';\n\n// ============ 第一步：选择大模型  ============\n\nconst llm = new ChatERNIEBot({\n  token: process.env.EB_ACCESS_TOKEN, // 飞桨平台的 token\n});\n\n// ============ 第二步：创建 AI 助手  ============\n\nconst assistant = createAssistant({\n  llm,\n});\n\n// ============ 第三步：启动 wechaty 服务  ============\n\nconst bot = WechatyBuilder.build({\n  name: 'demo',\n  puppet: 'wechaty-puppet-wechat4u',\n  puppetOptions: { uos: true },\n});\n\nbot.use(QRCodeTerminal({ small: true }));\n\n// 作为插件使用\nbot.use(assistant.callback());\n\nbot.start();\n```\n\n同时接入多个大模型。\n\n```ts\nimport {\n  ChatERNIEBot,\n  ChatQWen,\n  createAssistant,\n  MultiChatModelSwitch,\n} from '@zhengxs/wechaty-plugin-assistant';\n\nconst assistant = createAssistant({\n  llm: new MultiChatModelSwitch([\n    new ChatERNIEBot(),\n    new ChatQWen(),\n    // more...\n  ]),\n});\n```\n\n\u003cdiv align=\"right\"\u003e\n\n[![][back-to-top]](#readme-top)\n\n\u003c/div\u003e\n\n## 🧰 内置功能\n\n### 口令\n\n| 口令                               | 描述                                                                          |\n| ---------------------------------- | ----------------------------------------------------------------------------- |\n| `新对话` \\\\ `新聊天` \\\\ `重新开始` | 模拟 Web UI 的 创建新聊天 功能                                                |\n| `停止` \\\\ `停止回复`               | 模拟 Web UI 的 停止生成 按钮                                                  |\n| `查看模型` \\\\ `切换 xxx`           | `MultiChatModelSwitch` 模块添加的功能，允许配置多个模型，由最终使用者自己切换 |\n\n### 指令\n\n\u003e [!NOTE]\n\u003e 不再内置指令，改为按需手动注册。\n\n| 名称     | 描述                                                                                                                          | 状态  |\n| -------- | ----------------------------------------------------------------------------------------------------------------------------- | ----- |\n| `/deepl` | DeepL 翻译，感谢 [bob-plugin-akl-deepl-free-translate][bob-plugin-deepl] 提供的代码 以及 [deepL](https://deepl.com/) 提供服务 | Alpha |\n| `/dict`  | 汉字解释，感谢 [Pear][pear-api] 提供的 API                                                                                    | Alpha |\n| `/hot`   | 热搜榜，感谢 [韩小韩][han-api] 提供的 API                                                                                     | Alpha |\n| `/kfc`   | 疯狂星期四文案，感谢 [Brick][brick-api] 提供的 API                                                                            | Alpha |\n| `/moyu`  | 摸鱼日历，感谢 [韩小韩][brick-api] 提供的 API 以及 摸鱼日历 提供的图片                                                        | Alpha |\n\n\u003cdiv align=\"right\"\u003e\n\n[![][back-to-top]](#readme-top)\n\n\u003c/div\u003e\n\n## 🪢 AI 模型\n\n目前仅支持官方 API 调用，暂不提供 Web API 的代理。\n\n| 名称                                     | 公司      | 描述                                                                                               | 代码         | 状态  |\n| ---------------------------------------- | --------- | -------------------------------------------------------------------------------------------------- | ------------ | ----- |\n| 文心一言                                 | 百度      | 支持 [百度千帆][bce-yiyan] 和 [AI Studio][as-yiyan] 的 API 调用                                    | ChatERNIEBot | Alpha |\n| [通义千问][ali-qwen]                     | 阿里      | 支持阿里云 [DashScope][aliyun-dashscope-model-list] 的大部分模型，如`qwen` 和 `qwen-vl` 系列的模型 | ChatQWen     | Alpha |\n| [混元助手](https://hunyuan.tencent.com/) | 腾讯      |                                                                                                    | ChatHunYuan  | Alpha |\n| [星火认知][spark-api]                    | 讯飞      | 支持 `1.5 \\| 2 \\| 3` 模型                                                                          | ChatSpark    | Alpha |\n| [MM智能助理][mm-api]                     | 稀宇科技  | 支持 `abab5-chat \\| abab5.5-chat \\| abab5.5-chat-pro` 模型                                         | ChatMinimax  | Alpha |\n| Claude                                   | Anthropic | 基于 [Claude](https://claude.ai/chats) Web API，内部已配置 [反向代理服务][apifox]                  | ChatClaudeAI | Alpha |\n| ChatGPT                                  | OpenAI    | 推荐 [代理][openai-proxy]                                                                          | ChatOpenAI   | Alpha |\n| Bard                                     | Google    |                                                                                                    | -            | N/A   |\n\n\u003cdiv align=\"right\"\u003e\n\n[![][back-to-top]](#readme-top)\n\n\u003c/div\u003e\n\n## ⌨️ 本地开发\n\n可以使用 GitHub Codespaces 进行在线开发：\n\n[![][github-codespace-shield]][github-codespace-link]\n\n或者使用以下命令进行本地开发：\n\n```bash\n$ git clone https://github.com/zhengxs2018/wechaty-plugin-assistant.git\n$ cd wechaty-plugin-assistant\n$ pnpm install\n$ pnpm dev\n```\n\n\u003cdiv align=\"right\"\u003e\n\n[![][back-to-top]](#readme-top)\n\n\u003c/div\u003e\n\n## 🔗 更多工具\n\n- **[🤖 @zhengxs/ai](https://github.com/zhengxs2018/ai)** - 集成 百度文心一言，阿里通义千问，腾讯混元助手 和 讯飞星火认知 等国内大模型的 API，并且适配 OpenAI 的输入与输出。\n- **[将钉钉机器人接入 Wechaty](https://github.com/zhengxs2018/dingtalk-sdk-for-js/tree/main/packages/wechaty-puppet-dingtalk#readme)** - 开发中\n\n\u003cdiv align=\"right\"\u003e\n\n[![][back-to-top]](#readme-top)\n\n\u003c/div\u003e\n\n## 🤝 参与贡献\n\n我们非常欢迎各种形式的贡献。如果你对贡献代码感兴趣，可以查看我们的 GitHub [Issues][github-issues-link] 大展身手，向我们展示你的奇思妙想。\n\n[![][pr-welcome-shield]][pr-welcome-link]\n\n[![][github-contrib-shield]][github-contrib-link]\n\n\u003cdiv align=\"right\"\u003e\n\n[![][back-to-top]](#readme-top)\n\n\u003c/div\u003e\n\n## 🕘 Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=zhengxs2018/wechaty-plugin-assistant\u0026type=Date)](https://star-history.com/#zhengxs2018/wechaty-plugin-assistant\u0026Date)\n\n\u003cdiv align=\"right\"\u003e\n\n[![][back-to-top]](#readme-top)\n\n\u003c/div\u003e\n\n---\n\n#### 📝 License\n\nCopyright © 2023 [zhengxs2018][profile-link]. \u003cbr /\u003e\nThis project is [MIT](./LICENSE) licensed.\n\n\u003cdiv align=\"right\"\u003e\n\n[![][back-to-top]](#readme-top)\n\n\u003c/div\u003e\n\n[profile-link]: https://github.com/zhengxs2018\n[apifox]: https://openai-proxy.apifox.cn/\n[openai-proxy]: https://www.openai-proxy.com/\n[bob-plugin-deepl]: https://github.com/akl7777777/bob-plugin-akl-deepl-free-translate\n[pear-api]: https://api.pearktrue.cn/\n[han-api]: https://api.vvhan.com/\n[brick-api]: https://api.001500.cn/\n[as-yiyan]: https://aistudio.baidu.com/cooperate/yiyan\n[bce-yiyan]: https://cloud.baidu.com/doc/WENXINWORKSHOP/index.html\n[ali-qwen]: https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-thousand-questions/\n[spark-api]: https://xinghuo.xfyun.cn/sparkapi\n[mm-api]: https://api.minimax.chat/\n[back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-black?style=flat-square\n[aliyun-dashscope-model-list]: https://help.aliyun.com/zh/dashscope/developer-reference/model-square/\n[npm-release-shield]: https://img.shields.io/npm/v/@zhengxs/wechaty-plugin-assistant?color=369eff\u0026labelColor=black\u0026logo=npm\u0026logoColor=white\u0026style=flat-square\n[npm-release-link]: https://www.npmjs.com/package/@zhengxs/wechaty-plugin-assistant\n[npm-downloads-shield]: https://img.shields.io/npm/dt/@zhengxs/wechaty-plugin-assistant?labelColor=black\u0026style=flat-square\n[npm-downloads-link]: https://www.npmjs.com/package/@zhengxs/wechaty-plugin-assistant\n[npm-types-shield]: https://img.shields.io/npm/types/@zhengxs/wechaty-plugin-assistant?labelColor=black\u0026style=flat-square\n[npm-types-link]: https://www.npmjs.com/package/@zhengxs/wechaty-plugin-assistant\n[github-issues-link]: https://github.com/zhengxs2018/wechaty-plugin-assistant/issues\n[pr-welcome-shield]: https://img.shields.io/badge/%F0%9F%A4%AF%20PR%20WELCOME-%E2%86%92-ffcb47?labelColor=black\u0026style=for-the-badge\n[pr-welcome-link]: https://github.com/zhengxs2018/wechaty-plugin-assistant/pulls\n[github-contrib-shield]: https://contrib.rocks/image?repo=zhengxs2018%2Fwechaty-plugin-assistant\n[github-contrib-link]: https://github.com/zhengxs2018/wechaty-plugin-assistant/graphs/contributors\n[github-codespace-shield]: https://github.com/codespaces/badge.svg\n[github-codespace-link]: https://codespaces.new/zhengxs2018/wechaty-plugin-assistant\n[npm-release-shield]: https://img.shields.io/npm/v/@zhengxs/wechaty-plugin-assistant?color=369eff\u0026labelColor=black\u0026logo=npm\u0026logoColor=white\u0026style=flat-square\n[npm-release-link]: https://www.npmjs.com/package/@zhengxs/wechaty-plugin-assistant\n[github-releasedate-shield]: https://img.shields.io/github/release-date/zhengxs2018/wechaty-plugin-assistant?labelColor=black\u0026style=flat-square\n[github-releasedate-link]: https://github.com/zhengxs2018/wechaty-plugin-assistant/releases\n[github-contributors-shield]: https://img.shields.io/github/contributors/zhengxs2018/wechaty-plugin-assistant?color=c4f042\u0026labelColor=black\u0026style=flat-square\n[github-contributors-link]: https://github.com/zhengxs2018/wechaty-plugin-assistant/graphs/contributors\n[github-forks-shield]: https://img.shields.io/github/forks/zhengxs2018/wechaty-plugin-assistant?color=8ae8ff\u0026labelColor=black\u0026style=flat-square\n[github-forks-link]: https://github.com/zhengxs2018/wechaty-plugin-assistant/network/members\n[github-stars-shield]: https://img.shields.io/github/stars/zhengxs2018/wechaty-plugin-assistant?color=ffcb47\u0026labelColor=black\u0026style=flat-square\n[github-stars-link]: https://github.com/zhengxs2018/wechaty-plugin-assistant/network/stargazers\n[github-issues-shield]: https://img.shields.io/github/issues/zhengxs2018/wechaty-plugin-assistant?color=ff80eb\u0026labelColor=black\u0026style=flat-square\n[github-issues-link]: https://github.com/zhengxs2018/wechaty-plugin-assistant/issues\n[github-license-shield]: https://img.shields.io/github/license/zhengxs2018/wechaty-plugin-assistant?color=white\u0026labelColor=black\u0026style=flat-square\n[github-license-link]: https://github.com/zhengxs2018/wechaty-plugin-assistant/blob/main/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhengxs2018%2Fwechaty-plugin-assistant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhengxs2018%2Fwechaty-plugin-assistant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhengxs2018%2Fwechaty-plugin-assistant/lists"}