{"id":19175785,"url":"https://github.com/connectai-e/feishu-wenxin","last_synced_at":"2025-06-21T09:04:52.102Z","repository":{"id":170930000,"uuid":"647066644","full_name":"ConnectAI-E/Feishu-Wenxin","owner":"ConnectAI-E","description":"🍍飞书 × 百度文心一言 = 点亮灵感，享受国内模型的心流体验","archived":false,"fork":false,"pushed_at":"2023-08-30T23:04:48.000Z","size":1112,"stargazers_count":40,"open_issues_count":8,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-21T09:03:55.323Z","etag":null,"topics":["connect-ai","ernie","feishu","feishu-bot","go","golang","wenxinyiyan"],"latest_commit_sha":null,"homepage":"https://www.connectai-e.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ConnectAI-E.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":"2023-05-30T01:52:30.000Z","updated_at":"2025-04-22T08:36:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"b5343360-a0dd-4d35-98e5-77540a13ddd1","html_url":"https://github.com/ConnectAI-E/Feishu-Wenxin","commit_stats":null,"previous_names":["connectai-e/feishu-wenxin"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ConnectAI-E/Feishu-Wenxin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnectAI-E%2FFeishu-Wenxin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnectAI-E%2FFeishu-Wenxin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnectAI-E%2FFeishu-Wenxin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnectAI-E%2FFeishu-Wenxin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ConnectAI-E","download_url":"https://codeload.github.com/ConnectAI-E/Feishu-Wenxin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConnectAI-E%2FFeishu-Wenxin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261095303,"owners_count":23108782,"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":["connect-ai","ernie","feishu","feishu-bot","go","golang","wenxinyiyan"],"created_at":"2024-11-09T10:25:06.387Z","updated_at":"2025-06-21T09:04:47.087Z","avatar_url":"https://github.com/ConnectAI-E.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align='center'\u003e\n    \u003ca href='https://www.connectai-e.com' target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n    \u003cimg src='https://user-images.githubusercontent.com/50035229/241976353-1761fc99-0527-4daa-8e87-2915c648d53d.png' alt='' width='800'/\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\n\n\u003cdetails align='center'\u003e\n    \u003csummary\u003e 📷 点击展开完整功能\u003c/summary\u003e\n    \u003cbr\u003e\n    \u003cp align='center'\u003e\n    \u003cimg src='https://github.com/ConnectAI-E/Feishu-Wenxin/assets/50035229/5c93f949-3487-4910-b952-94eb5fc31d5a' alt='联系上下文' width='800'/\u003e\n    \u003cimg src='https://github.com/ConnectAI-E/Feishu-Wenxin/assets/50035229/bcc410b0-c50d-40a6-a751-1828a4905bd1' alt='帮助列表' width='800'/\u003e\n    \u003c/p\u003e\n\u003c/details\u003e\n\n\n\n\n\u003cbr\u003e\n\n\u003cp align='center'\u003e\n   飞书 × 文心一言\n\u003cbr\u003e\n\u003cbr\u003e\n    🚀 Feishu WenXin 🚀\n\u003c/p\u003e\n\n\u003cp align='center'\u003e\n  😀企联AI共创计划正式开启😀\n\u003c/p\u003e\n  \n\u003cp align='center'\u003e\n   www.connectai-e.com\n\u003c/p\u003e\n\n\n\n|       \u003cdiv style=\"width:300px\"\u003eAI\u003c/div\u003e        |                            \u003cimg width=100\u003e SDK \u003cimg width=100\u003e                             |                         Application                          |\n| :---------------: | :----------------------------------------------------------: | :----------------------------------------------------------: |\n|      🎒OpenAI      |    [Go-OpenAI](https://github.com/ConnectAI-E/Go-OpenAI)     | [🏅Feishu-OpenAI](https://github.com/ConnectAI-E/Feishu-OpenAI), [Lark-OpenAI](https://github.com/ConnectAI-E/Lark-OpenAI), [Feishu-EX-ChatGPT](https://github.com/ConnectAI-E/Feishu-EX-ChatGPT), [Feishu-OpenAI-Stream-Chatbot](https://github.com/ConnectAI-E/Feishu-OpenAI-Stream-Chatbot), [Feishu-OpenAI-Amazing](https://github.com/ConnectAI-E/Feishu-OpenAI-Amazing), [Feishu-Oral-Friend](https://github.com/ConnectAI-E/Feishu-Oral-Friend), [Feishu-OpenAI-Base-Helper](https://github.com/ConnectAI-E/Feishu-OpenAI-Base-Helper), [Feishu-Vector-Knowledge-Management](https://github.com/ConnectAI-E/Feishu-Vector-Knowledge-Management), [Feishu-OpenAI-PDF-Helper](https://github.com/ConnectAI-E/Feishu-OpenAI-PDF-Helper), [🏅Dingtalk-OpenAI](https://github.com/ConnectAI-E/Dingtalk-OpenAI), [Wework-OpenAI](https://github.com/ConnectAI-E/Wework-OpenAI), [WeWork-OpenAI-Node](https://github.com/ConnectAI-E/WeWork-OpenAI-Node), [llmplugin](https://github.com/ConnectAI-E/llmplugin) |\n|  🎭 Stablediffusion  |                            ------                            | [🏅Feishu-Stablediffusion](https://github.com/ConnectAI-E/Feishu-Stablediffusion) |\n|   🍎 Midjourney    | [Go-Midjourney](https://github.com/ConnectAI-E/Feishu-Midjourney/tree/main/midjourney) | [🏅Feishu-Midjourney](https://github.com/ConnectAI-E/Feishu-Midjourney), [MidJourney-Web](https://github.com/ConnectAI-E/MidJourney-Web), [Dingtalk-Midjourney](https://github.com/ConnectAI-E/Dingtalk-Midjourney) |\n|    🍍 文心一言     |    [Go-Wenxin](https://github.com/ConnectAI-E/Go-Wenxin)     | [Feishu-Wenxin](https://github.com/ConnectAI-E/Feishu-Wenxin), [Dingtalk-Wenxin](https://github.com/ConnectAI-E/Dingtalk-Wenxin), [Wework-Wenxin](https://github.com/ConnectAI-E/Wework-Wenxin) |\n|     💸 Minimax     |   [Go-Minimax](https://github.com/ConnectAI-E/Go-Minimax)    | [Feishu-Minimax](https://github.com/ConnectAI-E/Feishu-Minimax), [Dingtalk-Minimax](https://github.com/ConnectAI-E/Dingtalk-Minimax), [Wework-Minimax](https://github.com/ConnectAI-E/Wework-Minimax) |\n|     ⛳️ CLAUDE      |    [Go-Claude](https://github.com/ConnectAI-E/Go-Claude)     | [Feishu-Claude](https://github.com/ConnectAI-E/Feishu-Claude), [DingTalk-Claude](https://github.com/ConnectAI-E/DingTalk-Claude), [Wework-Claude](https://github.com/ConnectAI-E/Wework-Claude) |\n|     🎡 Prompt      |                                                              | [Prompt-Engineering-Tutior](https://github.com/ConnectAI-E/Prompt-Engineering-Tutior) |\n|     🤖️ ChatGLM     |                                                              | [Feishu-ChatGLM](https://github.com/ConnectAI-E/Feishu-ChatGLM) |\n\n\n\n\n## 👻 机器人功能\n\n🗣 语音交流：私人直接与机器人畅所欲言\n\n💬 多话题对话：支持私人和群聊多话题讨论，高效连贯\n\n🔄 上下文保留：回复对话框即可继续同一话题讨论\n\n⏰ 自动结束：超时自动结束对话，支持清除讨论历史\n\n📝 富文本卡片：支持富文本卡片回复，信息更丰富多彩\n\n👍 交互式反馈：即时获取机器人处理结果\n\n\n\n\n\n## 🌟 项目特点\n\n- 🍏 对话基于 文心一言 (https://ai.baidu.com/wenxinworkshop/app/overview) 接口 和 [go-wenxin](https://github.com/ConnectAI-E/go-wenxin) SDK\n- 🍎 将 文心一言 接入[飞书](https://open.feishu.cn/app)和[飞书国际版](https://www.larksuite.com/)\n- 🥒 支持[Serverless 云函数](https://github.com/serverless-devs/serverless-devs)、[本地环境](https://dashboard.cpolar.com/login)、[Docker](https://www.docker.com/)、[二进制安装包](https://github.com/Leizhenpeng/feishu-chatgpt/releases/)\n  等多种渠道部署\n- 🍋 基于[goCache](https://github.com/patrickmn/go-cache)内存键值对缓存\n\n## 项目部署\n\n###### 有关飞书的配置文件说明，**[➡︎ 点击查看](#详细配置步骤)**\n\n\u003cdetails\u003e\n    \u003csummary\u003e本地部署\u003c/summary\u003e\n\u003cbr\u003e\n\n```bash\ngit clone git@github.com:Leizhenpeng/feishu-wenxin.git\ncd feishu-wenxin/code\n```\n\n如果你的服务器没有公网 IP，可以使用反向代理的方式\n\n飞书的服务器在国内对 ngrok 的访问速度很慢，所以推荐使用一些国内的反向代理服务商\n\n- [cpolar](https://dashboard.cpolar.com/)\n- [natapp](https://natapp.cn/)\n\n```bash\n# 配置config.yaml\nmv config.example.yaml config.yaml\n\n//测试部署\ngo run main.go\ncpolar http 9000\n\n//正式部署\nnohup cpolar http 9000 -log=stdout \u0026\n\n//查看服务器状态\nhttps://dashboard.cpolar.com/status\n\n// 下线服务\nps -ef | grep cpolar\nkill -9 PID\n```\n\n更多详细介绍，参考[飞书上的小计算器: Go 机器人来啦](https://www.bilibili.com/video/BV1nW4y1378T/)\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003eserverless云函数(阿里云等)部署\u003c/summary\u003e\n\u003cbr\u003e\n\n```bash\ngit clone git@github.com:Leizhenpeng/feishu-wenxin.git\ncd feishu-wenxin/code\n```\n\n安装[severless](https://docs.serverless-devs.com/serverless-devs/quick_start)工具\n\n```bash\n# 配置config.yaml\nmv config.example.yaml config.yaml\n# 安装severless cli\nnpm install @serverless-devs/s -g\n```\n\n安装完成后，请根据您本地环境，根据下面教程部署`severless`\n\n- 本地 `linux`/`mac os` 环境\n\n1. 修改`s.yaml`中的部署地区和部署秘钥\n\n```\nedition: 1.0.0\nname: feishuBot-wenxin\naccess: \"aliyun\" #  修改自定义的秘钥别称\n\nvars: # 全局变量\nregion: \"cn-hongkong\" # 修改云函数想要部署地区\n\n```\n\n2. 一键部署\n\n```bash\ncd ..\ns deploy\n```\n\n- 本地`windows`\n\n1. 首先打开本地`cmd`命令提示符工具，运行`go env`检查你电脑上 go 环境变量设置, 确认以下变量和值\n\n```cmd\nset GO111MODULE=on\nset GOARCH=amd64\nset GOOS=linux\nset CGO_ENABLED=0\n```\n\n如果值不正确，比如您电脑上为`set GOOS=windows`, 请运行以下命令设置`GOOS`变量值\n\n```cmd\ngo env -w GOOS=linux\n```\n\n2. 修改`s.yaml`中的部署地区和部署秘钥\n\n```\nedition: 1.0.0\nname: feishuBot-chatGpt\naccess: \"aliyun\" #  修改自定义的秘钥别称\n\nvars: # 全局变量\n  region: \"cn-hongkong\" #  修改云函数想要部署地区\n\n```\n\n3. 修改`s.yaml`中的`pre-deploy`, 去除第二步`run`前面的环变量改置部分\n\n```\n  pre-deploy:\n        - run: go mod tidy\n          path: ./code\n        - run: go build -o\n            target/main main.go  # 删除GO111MODULE=on GOOS=linux GOARCH=amd64 CGO_ENABLED=0\n          path: ./code\n\n```\n\n4. 一键部署\n\n```bash\ncd ..\ns deploy\n```\n\n更多详细介绍，参考[仅需 1min，用 Serverless 部署基于 gin 的飞书机器人](https://www.bilibili.com/video/BV1nW4y1378T/)\n\u003cbr\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003edocker部署\u003c/summary\u003e\n\u003cbr\u003e\n\n```bash\ndocker build -t feishu-chatgpt:latest .\ndocker run -d --name feishu-chatgpt -p 9000:9000 \\\n--env APP_ID=xxx \\\n--env APP_SECRET=xxx \\\n--env APP_ENCRYPT_KEY=xxx \\\n--env APP_VERIFICATION_TOKEN=xxx \\\n--env BOT_NAME=chatGpt \\\n--env WENXIN_CLIENT_ID=\"xxx\" \\\n--env WENXIN_CLIENT_SECRET=\"xxx\" \\\nfeishu-chatgpt:latest\n```\n\n注意:\n\n- `BOT_NAME` 为飞书机器人名称，例如 `chatGpt`\n-  `WENXIN_CLIENT_ID` 为文心一言应用的 `API_Key`\n-  `WENXIN_CLIENT_SECRET` 为文心一言应用的 `Secret_Key`\n\n\n---\n\n小白简易化 docker 部署\n\n- docker 地址: https://hub.docker.com/r/leizhenpeng/feishu-chatgpt\n\n```bash\ndocker run -d --restart=always --name feishu-chatgpt2 -p 9000:9000 -v /etc/localtime:/etc/localtim:ro  \\\n--env APP_ID=xxx \\\n--env APP_SECRET=xxx \\\n--env APP_ENCRYPT_KEY=xxx \\\n--env APP_VERIFICATION_TOKEN=xxx \\\n--env BOT_NAME=chatGpt \\\n--env WENXIN_CLIENT_ID=\"xxx\" \\\n--env WENXIN_CLIENT_SECRET=\"xxx\" \\\ndockerproxy.com/leizhenpeng/feishu-wenxin:latest\n```\n\n事件回调地址: http://IP:9000/webhook/event\n卡片回调地址: http://IP:9000/webhook/card\n\n把它填入飞书后台\n\n--- \n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003edocker-compose 部署\u003c/summary\u003e\n\u003cbr\u003e\n\n编辑 docker-compose.yaml，通过 environment 配置相应环境变量（或者通过 volumes 挂载相应配置文件），然后运行下面的命令即可\n\n```bash\n# 构建镜像\ndocker compose build\n\n# 启动服务\ndocker compose up -d\n\n# 停止服务\ndocker compose down\n```\n\n事件回调地址: http://IP:9000/webhook/event\n卡片回调地址: http://IP:9000/webhook/card\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n    \u003csummary\u003e二进制安装包部署\u003c/summary\u003e\n\u003cbr\u003e\n\n1. 进入[release 页面](https://github.com/Leizhenpeng/feishu-wenxin/releases/) 下载对应的安装包\n2. 解压安装包,修改 config.example.yml 中配置信息,另存为 config.yaml\n3. 运行程序入口文件 `feishu-chatgpt`\n\n事件回调地址: http://IP:9000/webhook/event\n卡片回调地址: http://IP:9000/webhook/card\n\n\u003c/details\u003e\n\n## 详细配置步骤\n\n\u003cdetails align='left'\u003e\n    \u003csummary\u003e 📸 点击展开飞书机器人配置的分步截图指导\u003c/summary\u003e\n    \u003cbr\u003e\n    \u003cp align='center'\u003e\n    \u003cimg src='https://user-images.githubusercontent.com/50035229/223943381-39e0466f-2a5e-472a-9863-94eafb5f17b0.png' alt='' width='800'/\u003e\n    \u003cimg src='https://user-images.githubusercontent.com/50035229/223943448-228de5cb-0929-4d80-8087-8d8624dd6ddf.png' alt='' width='800'/\u003e\n    \u003cimg src='https://user-images.githubusercontent.com/50035229/223943485-ef331784-7940-4657-b128-70c98391e72f.png' alt='' width='800'/\u003e\n    \u003cimg src='https://user-images.githubusercontent.com/50035229/223943527-60e6653a-eb6e-4062-a076-b6c9da934352.png' alt='' width='800'/\u003e\n    \u003cimg src='https://user-images.githubusercontent.com/50035229/223943972-f49adf9f-af5f-463a-8c7a-c1f0cac0e8c3.png' alt='' width='800'/\u003e\n      \u003cimg src='https://user-images.githubusercontent.com/50035229/223944060-7ef630a4-4248-4509-852b-cad8bfffeefc.png' alt='' width='800'/\u003e\n      \u003cimg src='https://user-images.githubusercontent.com/50035229/223944230-aff586be-31cc-40de-9b1a-7d4e259d54dd.png' alt='' width='800'/\u003e\n      \u003cimg src='https://user-images.githubusercontent.com/50035229/223944350-917d115c-6c82-4d8b-9ec8-b5c82331a2dc.png' alt='' width='800'/\u003e\n      \u003cimg src='https://user-images.githubusercontent.com/50035229/223944381-97396156-f5e2-467f-aaf6-b1f6e1c446b2.png' alt='' width='800'/\u003e\n      \u003cimg src='https://user-images.githubusercontent.com/50035229/230003546-36450f2f-b6e9-4292-8b40-3a4aa8a05a64.png' alt='' width='800'/\u003e\n      \u003cimg src='https://user-images.githubusercontent.com/50035229/223945122-f7ab3d9a-6742-43d2-970e-ddb0f284c7fa.png' alt='' width='800'/\u003e\n      \u003cimg src='https://user-images.githubusercontent.com/50035229/223944507-8d1a08d7-8b5b-4f32-a90d-fd338164ec82.png' alt='' width='800'/\u003e\n      \u003cimg src='https://user-images.githubusercontent.com/50035229/223944515-fb505e84-c840-484a-8df5-612f60bf27ea.png' alt='' width='800'/\u003e\n      \u003cimg src='https://user-images.githubusercontent.com/50035229/223944590-ad61320f-c14a-4542-80ad-dee2e6469b67.png' alt='' width='800'/\u003e\n    \u003c/p\u003e\n\u003c/details\u003e\n\n\n- 获取 [文心一言](https://console.bce.baidu.com/ai/#/ai/wenxinworkshop/app/list) 的 API_Key、Secret_Key\n- 创建 [飞书](https://open.feishu.cn/) 机器人\n    1. 前往[开发者平台](https://open.feishu.cn/app?lang=zh-CN)创建应用,并获取到 APPID 和 Secret\n    2. 前往`应用功能-机器人`, 创建机器人\n    3. 从 cpolar、serverless 或 Railway 获得公网地址，在飞书机器人后台的 `事件订阅` 板块填写。例如，\n        - `http://xxxx.r6.cpolar.top`为 cpolar 暴露的公网地址\n        - `/webhook/event`为统一的应用路由\n        - 最终的回调地址为 `http://xxxx.r6.cpolar.top/webhook/event`\n    4. 在飞书机器人后台的 `机器人` 板块，填写消息卡片请求网址。例如，\n        - `http://xxxx.r6.cpolar.top`为 cpolar 暴露的公网地址\n        - `/webhook/card`为统一的应用路由\n        - 最终的消息卡片请求网址为 `http://xxxx.r6.cpolar.top/webhook/card`\n    5. 在事件订阅板块，搜索三个词`机器人进群`、 `接收消息`、 `消息已读`, 把他们后面所有的权限全部勾选。\n       进入权限管理界面，搜索`图片`, 勾选`获取与上传图片或文件资源`。\n       最终会添加下列回调事件\n        - im:resource(获取与上传图片或文件资源)\n        - im:message\n        - im:message.group_at_msg(获取群组中所有消息)\n        - im:message.group_at_msg:readonly(接收群聊中@机器人消息事件)\n        - im:message.p2p_msg(获取用户发给机器人的单聊消息)\n        - im:message.p2p_msg:readonly(读取用户发给机器人的单聊消息)\n        - im:message:send_as_bot(获取用户在群组中@机器人的消息)\n        - im:chat:readonly(获取群组信息)\n        - im:chat(获取与更新群组信息)\n\n\n5. 发布版本，等待企业管理员审核通过\n\n更多介绍，参考[飞书上的小计算器: Go 机器人来啦](https://www.bilibili.com/video/BV12M41187rV/)\n\n## 商业支持\n\n如果开源版无法满足您公司的需求，推荐您尝试企联AI的商业共创版\n\n- 内置开箱即用的Azure Openai: 无需部署到海外，即可获得数十倍的性能提升\n- 掌控全局的Admin Panel: AI资源管理、对话日志查询、风险词规避和对话权限管理\n- 专人技术支持: 配备专业部署交付人员与后期一对一维护服务\n- 同时提供在线Saas版/企业级私有部署\n\n查看更多内容: https://www.connectai-e.com\n\n企业客户咨询: 15623677720\n\n\u003cimg width=\"300\" src=\"https://github.com/DDMeaqua/Feishu-OpenAI/assets/110169811/0a07f7e2-183f-4ee4-a40a-e33ee5c440e4\"\u003e\n\u003cimg width=\"300\" src=\"https://github.com/ConnectAI-E/Feishu-OpenAI/assets/110169811/ef313ce0-158e-4314-a932-e6b1180cc750\"\u003e\n\n## 一起交流\n\n遇到问题，可以加入飞书群沟通~\n\n\u003cimg src='https://github.com/ConnectAI-E/Feishu-Wenxin/assets/50035229/4b15d91e-cd65-4f2f-987a-7eba8326b017' alt='' width='200'/\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnectai-e%2Ffeishu-wenxin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconnectai-e%2Ffeishu-wenxin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnectai-e%2Ffeishu-wenxin/lists"}