{"id":13455765,"url":"https://github.com/sytpb/chatgpt-wework-robot","last_synced_at":"2025-04-05T21:07:30.646Z","repository":{"id":153681692,"uuid":"629021713","full_name":"sytpb/chatgpt-wework-robot","owner":"sytpb","description":"零代码、一键部署chatgpt到企业微信，无须VPN，速度快","archived":false,"fork":false,"pushed_at":"2023-08-30T10:29:45.000Z","size":213,"stargazers_count":383,"open_issues_count":1,"forks_count":113,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-29T19:08:20.954Z","etag":null,"topics":["automatic","chatbot","chatgpt","cloudfunction","node-js","nodejs","one-click-deploy","wechat-bot","wecom","wecom-bot","weixin","wework","wexinbot"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/sytpb.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-04-17T13:11:36.000Z","updated_at":"2025-03-01T18:52:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"f6149b79-c68b-48a9-83ed-8ddd61b3a8b6","html_url":"https://github.com/sytpb/chatgpt-wework-robot","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sytpb%2Fchatgpt-wework-robot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sytpb%2Fchatgpt-wework-robot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sytpb%2Fchatgpt-wework-robot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sytpb%2Fchatgpt-wework-robot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sytpb","download_url":"https://codeload.github.com/sytpb/chatgpt-wework-robot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399877,"owners_count":20932876,"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":["automatic","chatbot","chatgpt","cloudfunction","node-js","nodejs","one-click-deploy","wechat-bot","wecom","wecom-bot","weixin","wework","wexinbot"],"created_at":"2024-07-31T08:01:10.746Z","updated_at":"2025-04-05T21:07:30.617Z","avatar_url":"https://github.com/sytpb.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Chatbots"],"sub_categories":[],"readme":"# 零代码 一键部署chatGPT到企业微信应用 无须翻墙\u003cbr/\u003e\n\n\u003cdiv align=\"center\"\u003e\n     \u003cimg src=\"https://github.com/sytpb/chatgpt-wework-robot/assets/12178686/13e3a894-75e2-4c3d-a4fa-5565940121fa\" width=\"120px\"\u003e\n\u003c/div\u003e\n\u003cdiv align=\"center\"  style=\"font-size: 12px; line-height: 12px;\"\u003e\n   在微信中使用场景\n\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\n    \u003ckbd\u003e\n        \u003cimg src=\"https://github.com/sytpb/chatgpt-wework-robot/assets/12178686/df55ac4f-e6f2-480b-b1cc-06299a07651a\" width=\"600px\"\u003e\n    \u003c/kbd\u003e\n\u003c/div\u003e\n\u003cbr/\u003e\u003cbr/\u003e\n\n\n\u003cdiv align=\"center\"\u003e\n     \u003cimg src=\"https://github.com/sytpb/chatgpt-wework-robot/assets/12178686/69e6b599-f9fe-434a-ae38-1cd951cfd362\" width=\"120px\"\u003e\n\u003c/div\u003e\n\u003cdiv align=\"center\" style=\"display: inline-block;\"\u003e \n    在企业微信中使用场景\n\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\n    \u003ckbd\u003e\n        \u003cimg src=\"https://user-images.githubusercontent.com/12178686/233244040-7ab04261-79d7-4588-b8b1-18fc64d9f040.png\" width=\"400px\"\u003e\n    \u003c/kbd\u003e\n\u003c/div\u003e\n\u003cbr/\u003e\u003cbr/\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ckbd\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/12178686/233246963-9f7e5eb0-d78f-4286-8536-2f4e9f9bee11.png\" width=\"800px\"\u003e\n    \u003c/kbd\u003e\n\u003c/div\u003e\n\n\u003cbr/\u003e\u003cbr/\u003e\n\n\n\n\u003cdiv align=\"center\"  style=\"font-size: 12px; line-height: 12px;\"\u003e\n   ChatGPT 接入企业微信,赋能商业成功\n\u003c/div\u003e\n\n## 大模型AI客服邀请您体验\n我们基于chatgpt 大模型, 开发了Ai智能客服，Ai智能客服7*24小时服务能力，大大节省客服成本，提高公司服务效率。 \n接入场景包括 *微信*，*公众号*，*视频号小店*，*小程序*等\n需要体验的企业欢迎聊系我，名额有限。\n\n\n\u003cdiv align=\"center\"\u003e\n     \u003ckbd\u003e\n         \u003cimg src=\"https://github.com/sytpb/chatgpt-wework-robot/assets/12178686/9f2537aa-8dab-496f-b10d-08223f1f959b\" width=\"800px\"\u003e\n     \u003c/kbd\u003e\n\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e https://www.youtube.com/watch?v=Wd6zc7WmeUI \u003c/div\u003e\n\n## 钉钉一键部署ChatGPT\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/12178686/236364198-d1d7d298-16d0-4e81-aaf7-89d108f0eea3.png\" width=\"200px\"\u003e\n\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\n [钉钉一键部署ChatGPT](https://github.com/sytpb/chatgpt-dingtalk-robot)\n\u003c/div\u003e\n\n\n## 关于本项目\n本项目可以实现一键部署ChatGPT到企业微信中，使ChatGPT与企业微信完美融合，手机或电脑上，打开企业微信，就可以使用强大的ChatGPT智能问答。截止目前，本项目可以提供两个能力:\u003cbr\u003e\n\n1. 功能集成，将ChatGPT问答功能集成到企业微信中，借助企业微信权限功能，可以将ChatGPT共享到企业应用当中，此功能要求简单，有企业微信管理员权限即可，方法，参照下面的**Render一键部署**\n2. 更强大的功能扩展，本项目为开源项目，有开发能力的小伙伴可以Fork到自己的仓库，根据自己企业业务需要，比如结合企业微信开放的API，二次开发一些其他功能。\n\n3. 其他功能，后续更新。\n\n\n## Render一键部署\n**说明：Render 部署只适用于临时测试用，长期使用请用服务器方式部署，一个备案域名+一台海外节点服务器即可，需要协助部署请联系我。**\n\n[指导视频](https://youtu.be/UOm39-_Loaw)\n1. 创建企业微信应用\u003cbr\u003e\n\n第一步，创建应用，操作方法：企微管理员， 电脑端上的企业微信--\u003e头像--\u003e管理企业--\u003e应用管理--\u003e（最下面）创建应用--\u003e应用logo + 填入基本信息\n\n![image](https://user-images.githubusercontent.com/12178686/233253399-489b0905-9a4c-4b2e-8f5d-ed7e8dac0f6b.png)\n\n\n第二步，配置应用，操作方法：接收消息一栏--\u003e设置API接收--\u003e未完等待第四步。\n![image](https://user-images.githubusercontent.com/12178686/233256124-cc6334e3-90ff-43e7-8fe5-3dc0026226fb.png)\n\n第三步，记录和准备下列字段信息， **corpid, agentid, secret, token ,aeskey, open-api-key**\n\n**corpid** :  电脑端上的企业微信--\u003e头像--\u003e管理企业--\u003e我的企业（下方） 图略\u003cbr/\u003e\u003cbr/\u003e\n**agentid, secret**: 第一步里完成后可见。\n![image](https://user-images.githubusercontent.com/12178686/233275423-67281448-02ee-4e61-8586-0fe095351fb2.png)\n\n**token ,aeskey**： 在设置API接收里（上面第二步）\n\n**open-api-key**\n这个需要在ChatGPT账号里生成，（如果没有chatgpt 账号也可以让别人生成一个，但是这个会产生费用） \n![image](https://user-images.githubusercontent.com/12178686/233278134-9d3fb914-9f3a-4049-b20e-3b0f237239f6.png)\n\n[申请网址API KEY](https://platform.openai.com/account/api-keys)\n\n\n第四步，一键部署到Render（代理服务器，免费，可以升级付费） \n\u003ca href=\"https://render.com/deploy?repo=https://github.com/sytpb/chatgpt-wework-robot\"\u003e\n  \u003cimg src=\"https://render.com/images/deploy-to-render-button.svg\" alt=\"Deploy to Render\"\u003e\n\u003c/a\u003e\n\n\n![image](https://github.com/sytpb/chatgpt-wework-robot/assets/12178686/a82e7f63-6051-4765-a81e-67fdb9bbae55)\n\n**参数请参照下表完成**\n\n| Key                               |  value                         | 说明                                                                                                                                      |\n| --------------------------------- | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |\n| AESKEY                            |                                |                                                                                                                                           |\n| AGENTID                           |                                |                                                                                                                                           |\n| CORPID                            |                                |                                                                                                                                           |\n| OPENAI_API_KEY                    |                                |                                                                                                                                           |\n| OPENAI_MODEL                      |  gpt-3.5-turbo                 |     gpt-3.5-turbo 或者gpt-4    注意：不支持gpt4填入gpt-4无效                                                                               |\n| SECRET                            |                                |                                                                                                                                           |\n| TOKEN                             |                                |                                                                                                                                           |\n| MSG_TYPE                          |  xml                           |     xml 或者 markdown, xml:支持微信里使用                                                                                                  |\n| PORT                              |  6060                          |     可以改成其他                                                                                                                           |\n\n\n如图所示，将上面的字段信息填入，然后点击Apply。 \n\n\n需要等3-5分钟部署，完成后复制生成的服务的URL，如下图，**然后拷贝URL后面拼接上/message**, 比如URL是 https://abc.com 拼接成 https://abc.com/message， 粘贴到上面**第二步**页面里，然后点保存，看到提示类似”保存成功“，代表服务已经配置成功了！\n![image](https://user-images.githubusercontent.com/12178686/233277321-5392207b-58c5-4c6e-959e-de71518e4094.png)\n\n最后一步： 企业可信IP配置， 应用页的最下方，配置可信IP。 \n![image](https://user-images.githubusercontent.com/12178686/233280128-10dbcbdd-db47-47d2-91a0-8b20f2fd8893.png)\n\nIP地址如下图，Render-\u003eConnect-\u003eOutbound \n![image](https://user-images.githubusercontent.com/12178686/233280575-8d92c978-cf06-4763-9443-694f495d3e16.png)\n\n将这三个ip地址配置到可信IP里，至此所有配置工作完成。\n\u003cbr/\u003e\n\n:100: 下面就可以直接体验了，手机或电脑上企业微信进入自己创建的应用，可以和ChatGPT的聊起来了。 \n\n经过一段时间的测试，如果想提高回复速度，办法一是升级Render 为付费，另外一个最重要的因素是chatgpt回复的有延迟，因为用的是GPT 3.5 turbo, 如果是PLUS 用户的API Key 会快很多，这是本人的测试情况，供参考。\n\n\n### 使用方法\n1. 企业微信，工作台，找到你的应用，打开后直接发消息即可。\n2. 个人微信， 需要一些额外设置， 在企业微信后台\n\n    \u003ckbd\u003e\n        \u003cimg src=\"https://github.com/sytpb/chatgpt-wework-robot/assets/12178686/a8c55a14-72f7-4525-bba5-8743c98284cf\" width=\"400px\"\u003e\n    \u003c/kbd\u003e\n扫码后就可以在手机看到你的应用，打开后就可以使用了！\n\n\n### 问题汇总\n1. 服务器异常，稍后再试 \u003cbr/\u003e\n请检查服务是否部署完成和正常启动，需要看到your server is live字样才代表服务正常。\n\n2. openapi回调地址请求不通过 \u003cbr/\u003e\n请请检查你的接收地址配置是否正确， https://..../message ,必须https开头，/message/结束。\n\n3. 收到提示“域名主体校验未通过...” \u003cbr/\u003e\n解决办法： 原因腾讯对认证企业的安全检测，办法是需要企业有自己的域名，然后配置自己的域名CNAME指向上面的域名，这样就符合企业微信合规检测。\n更多细节请参考这里 https://render.com/docs/custom-domains\n\n\n4. 给AI发消息，只收到“正在生成回答”，服务端也看到了AI回复 \u003cbr/\u003e\n问题原因是没有配置可信IP。按文档中要求正确配置即可。\n\n5. 可信IP无法配置 \u003cbr/\u003e\n解决办法：提示不允许第三方IP, 要求公司自己的服务器的，原因腾讯对认证企业的安全检测，遇此问题的, 办法一是购买自己的服务器，将服务配置到服务器上，办法二是选择钉钉一键部署，钉钉没有此限制。\n\n6. 有时发消息没有回应 \u003cbr/\u003e\n刚一开始好用，过段时间发消息没有反应，这是因为render 免费版的限制， 每过一段时间不使用，render 服务会停止，再发消息会重新唤醒服务，这过程需要3-5分钟时间，方法是间隔发几条消息，直到他重新成功，\n才会收到回复。\n解决办法：升级成付费版本starter,或者自购服务器部署，可参考下面的docker部署。 \n## 服务器部署\n\u003cdetails\u003e\n    \u003csummary\u003e点击查看详细\u003c/summary\u003e\n\u003cbr\u003e\n以下方法适用于，已经拥有自己的独立的服务器的同学。\n1. 前提条件，有国内独立服务器，并且有自己独立的域名（企业微信信已认证的，要求域名在公司名下）\n域名解析参考\n\u003cimg src=\"https://user-images.githubusercontent.com/12178686/236603276-d4bed8fb-5ba0-488c-8da4-5014d2a6bf8d.png\"\u003e\n\n2. 安装nodejs ，以linux centos 举例，[以下过程作为参考，整个过程待后续详细确认]\ncentos 为例\n```\nsudo yum install nodejs  \n```\n3. github 获取代码\n```\ngit clone https://github.com/sytpb/chatgpt-wework-robot\n\n```\n4. 安装服务\n```\ncd chatgpt-wework-robot\nnpm install \n```\n\n5. 配置服务\n```\n cd /etc/systemd/system\n touch aistory.service\n```\nvim aistory.service 内容如下\n```\n[Unit]\nDescription = ai story service\nAfter = network.target\n\n[Service]\nExecStart = your path/aistory.sh\n\n[Install]\nWantedBy = multi-user.target\n```\n\naistory.sh\n```\n#!/bin/bash\nnpm run dev\n```\n\n```\nchmod +x aistory.sh\n```\n\n```\nsystemctl start aistory.service\n```\n\u003c/details\u003e\n\n## Docker部署\n\u003cdetails\u003e          \n\u003csummary\u003e点击查看详细署\u003c/summary\u003e\n\n\n1. 相较于**Render一键部署**方案，该方案需要:\n    - 一台服务器\n    - 一个域名\n\n1. 创建企业微信应用（参考`Render一键部署 1.创建企业微信应用 第一、二、三步`）\n\n1. 复制变量文件 `.env.example`，填写自己的配置\n\n    - 若服务器网络与openai api不能直连，可配置自定义 openai api 地址，`OPENAI_PROXY_URL`.  \n      若无需自定义，请留空.\n        ```yaml\n        OPENAI_PROXY_URL=openai.abc.com\n        ```\n\n1. 运行docker\n\n    假设新变量文件名为 `.env.local`\n\n    ```bash\n    # docker4bill/ww-openai-node:alpine 为构建好的镜像，你也可以利用本仓库的 Dockerfile 构建自己的镜像\n    docker run --env-file .env.local -p 6060:6060 -d docker4bill/ww-openai-node:alpine\n    ```\n\n1. 用 `caddy` 或者 `nginx` 给以上服务做个反代\n\n    假设域名是**abc.com**, 以`caddy`为例配置:\n\n    ```yaml\n    abc.com {\n      reverse_proxy localhost:6060\n    }\n    ```\n\n1. 将服务器IP添加到**企业可信IP**\n\n1. 填写**接收消息服务器配置 URL**\n\n    假设反代地址为`abc.com`，在**其后添加/message**，将地址`https://abc.com/message`填入接收消息服务器配置的URL里\n\u003c/details\u003e\n\n## 新功能调查\n\n您的工作场景，最想要Chatgpt为您做什么？除了现有的问答模式。假如需要以下功能，\n\n1、语音对话，什么场景用？\n\n2、图片生成，什么场景用？\n\n3、其他，请列举\n\n欢迎来群里讨论！\n\n\u003cdiv align=\"center\"\u003e\n     \u003cimg src=\"https://github.com/sytpb/chatgpt-wework-robot/assets/12178686/1370d669-180e-472f-bed8-e1d7e400e899\" width=\"200px\" alt=\"group\"\u003e\n\u003c/div\u003e\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsytpb%2Fchatgpt-wework-robot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsytpb%2Fchatgpt-wework-robot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsytpb%2Fchatgpt-wework-robot/lists"}