mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-20 13:47:15 +08:00
feat: docs update
This commit is contained in:
@@ -1,23 +1,21 @@
|
||||
---
|
||||
title: DingTalk
|
||||
description: Integrate CowAgent with DingTalk
|
||||
description: Integrate CowAgent into DingTalk application
|
||||
---
|
||||
|
||||
# DingTalk
|
||||
Integrate CowAgent into DingTalk by creating an intelligent robot app on the DingTalk Open Platform.
|
||||
|
||||
Create a smart bot application on the DingTalk Open Platform to integrate CowAgent.
|
||||
## 1. Create App
|
||||
|
||||
## 1. Create an App
|
||||
|
||||
1. Go to [DingTalk Developer Console](https://open-dev.dingtalk.com/fe/app#/corp/app), click **Create App**, and fill in the information
|
||||
2. Add the **Bot** capability
|
||||
3. Configure bot info and click **Publish**
|
||||
1. Go to [DingTalk Developer Console](https://open-dev.dingtalk.com/fe/app#/corp/app), click **Create App**, fill in app information
|
||||
2. Click **Add App Capability**, select **Robot** capability and add
|
||||
3. Configure robot information and click **Publish**
|
||||
|
||||
## 2. Project Configuration
|
||||
|
||||
1. Get `Client ID` and `Client Secret` from **Credentials & Basic Info**
|
||||
|
||||
2. Add to `config.json`:
|
||||
2. Fill in `config.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -33,8 +31,8 @@ Create a smart bot application on the DingTalk Open Platform to integrate CowAge
|
||||
pip3 install dingtalk_stream
|
||||
```
|
||||
|
||||
4. After starting the project, go to **Event Subscription** in the DingTalk console, click **Verify Connection** — it should show "Connection successful"
|
||||
4. After starting the project, go to DingTalk Developer Console **Event Subscription**, click **Connection verified, verify channel**. When "Connection successful" is displayed, configuration is complete
|
||||
|
||||
## 3. Usage
|
||||
|
||||
Chat with the bot privately or add it to a group chat to start a conversation.
|
||||
Chat privately with the robot or add it to an enterprise group to start a conversation.
|
||||
|
||||
@@ -1,25 +1,23 @@
|
||||
---
|
||||
title: Feishu (Lark)
|
||||
description: Integrate CowAgent with Feishu
|
||||
description: Integrate CowAgent into Feishu application
|
||||
---
|
||||
|
||||
# Feishu (Lark)
|
||||
Integrate CowAgent into Feishu by creating a custom app. Supports WebSocket (recommended, no public IP required) and Webhook event receiving modes.
|
||||
|
||||
Integrate CowAgent into Feishu by creating a custom app. Supports WebSocket (recommended) and Webhook event modes.
|
||||
## 1. Create Enterprise Custom App
|
||||
|
||||
## 1. Create a Custom App
|
||||
### 1.1 Create App
|
||||
|
||||
### Create the App
|
||||
Go to [Feishu Developer Platform](https://open.feishu.cn/app/), click **Create Enterprise Custom App**, fill in the required information and create.
|
||||
|
||||
Go to [Feishu Open Platform](https://open.feishu.cn/app/), click **Create Custom App**, and fill in the required information.
|
||||
### 1.2 Add Bot Capability
|
||||
|
||||
### Add Bot Capability
|
||||
In **Add App Capabilities**, add **Bot** capability to the app.
|
||||
|
||||
In the **Add App Capabilities** menu, add the **Bot** capability.
|
||||
### 1.3 Configure App Permissions
|
||||
|
||||
### Configure Permissions
|
||||
|
||||
Go to **Permission Management**, paste the following permissions, select all, and enable them:
|
||||
Click **Permission Management**, paste the following permission string, select all and enable in batch:
|
||||
|
||||
```
|
||||
im:message,im:message.group_at_msg,im:message.group_at_msg:readonly,im:message.p2p_msg,im:message.p2p_msg:readonly,im:message:send_as_bot,im:resource
|
||||
@@ -27,11 +25,11 @@ im:message,im:message.group_at_msg,im:message.group_at_msg:readonly,im:message.p
|
||||
|
||||
## 2. Project Configuration
|
||||
|
||||
Get `App ID` and `App Secret` from **Credentials & Basic Info**, then add to `config.json`:
|
||||
Get `App ID` and `App Secret` from **Credentials & Basic Info**, then fill in `config.json`:
|
||||
|
||||
<Tabs>
|
||||
<Tab title="WebSocket (Recommended)">
|
||||
No public IP required:
|
||||
<Tab title="WebSocket Mode (Recommended)">
|
||||
No public IP required. Configuration:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -44,8 +42,8 @@ Get `App ID` and `App Secret` from **Credentials & Basic Info**, then add to `co
|
||||
|
||||
Install dependency: `pip3 install lark-oapi`
|
||||
</Tab>
|
||||
<Tab title="Webhook">
|
||||
Requires public IP:
|
||||
<Tab title="Webhook Mode">
|
||||
Requires public IP. Configuration:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -62,8 +60,8 @@ Get `App ID` and `App Secret` from **Credentials & Basic Info**, then add to `co
|
||||
|
||||
## 3. Configure Event Subscription
|
||||
|
||||
1. After starting the project, go to **Events & Callbacks** on the Feishu Open Platform, select **Long Connection** mode, and save
|
||||
2. Click **Add Event**, search for "Receive Message", select "Receive Message v2.0", and confirm
|
||||
3. Go to **Version Management & Release**, create a new version, and submit for release approval
|
||||
1. After starting the project, go to Feishu Developer Platform **Events & Callbacks**, select **Long Connection** and save
|
||||
2. Click **Add Event**, search for "Receive Message", select "Receive Message v2.0", confirm and add
|
||||
3. Click **Version Management & Release**, create a version and apply for production release. After approval, you can use it
|
||||
|
||||
Once approved, search for the bot name in Feishu to start chatting.
|
||||
Search for the bot name in Feishu to start chatting.
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
---
|
||||
title: Web
|
||||
description: Use CowAgent through the Web interface
|
||||
description: Use CowAgent through the web interface
|
||||
---
|
||||
|
||||
# Web
|
||||
|
||||
Web is the default channel for CowAgent. A Web console starts automatically on launch, allowing you to chat with the Agent through your browser.
|
||||
Web is CowAgent's default channel. The web console starts automatically after launch, allowing you to chat with the Agent through a browser.
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -19,7 +17,7 @@ Web is the default channel for CowAgent. A Web console starts automatically on l
|
||||
| Parameter | Description | Default |
|
||||
| --- | --- | --- |
|
||||
| `channel_type` | Set to `web` | `web` |
|
||||
| `web_port` | Web service listening port | `9899` |
|
||||
| `web_port` | Web service listen port | `9899` |
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -29,5 +27,5 @@ After starting the project, visit:
|
||||
- Server: `http://<server-ip>:9899/chat`
|
||||
|
||||
<Note>
|
||||
Ensure your server firewall and security group allow access to the configured port.
|
||||
Ensure the server firewall and security group allow the corresponding port.
|
||||
</Note>
|
||||
|
||||
@@ -3,14 +3,12 @@ title: WeChat Official Account
|
||||
description: Integrate CowAgent with WeChat Official Accounts
|
||||
---
|
||||
|
||||
# WeChat Official Account
|
||||
|
||||
CowAgent supports both personal subscription accounts and enterprise service accounts.
|
||||
|
||||
| Type | Requirements | Features |
|
||||
| --- | --- | --- |
|
||||
| **Personal Subscription** | Available to individuals | Users must send a message to retrieve replies |
|
||||
| **Enterprise Service** | Enterprise registration with verified customer service API | Can proactively push replies to users |
|
||||
| **Enterprise Service** | Enterprise with verified customer service API | Can proactively push replies to users |
|
||||
|
||||
<Note>
|
||||
Official Accounts only support server and Docker deployment. Install extended dependencies: `pip3 install -r requirements-optional.txt`
|
||||
@@ -18,8 +16,6 @@ CowAgent supports both personal subscription accounts and enterprise service acc
|
||||
|
||||
## Personal Subscription Account
|
||||
|
||||
Add the following to `config.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"channel_type": "wechatmp",
|
||||
@@ -36,15 +32,15 @@ Add the following to `config.json`:
|
||||
1. Get parameters from [WeChat Official Account Platform](https://mp.weixin.qq.com/) under **Settings & Development → Basic Configuration → Server Configuration**
|
||||
2. Enable developer secret and add server IP to the whitelist
|
||||
3. Start the program (listens on port 80)
|
||||
4. In the official account console, **enable server configuration** with URL format `http://{HOST}/wx`
|
||||
4. Enable server configuration with URL format `http://{HOST}/wx`
|
||||
|
||||
## Enterprise Service Account
|
||||
|
||||
The setup is largely identical to the subscription account, with these differences:
|
||||
Same setup with these differences:
|
||||
|
||||
1. Register an enterprise service account and complete WeChat verification, ensure **Customer Service API** permission is granted
|
||||
1. Register an enterprise service account with verified **Customer Service API** permission
|
||||
2. Set `"channel_type": "wechatmp_service"` in `config.json`
|
||||
3. Replies can be proactively pushed to users without them having to manually retrieve them
|
||||
3. Replies can be proactively pushed to users
|
||||
|
||||
```json
|
||||
{
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
---
|
||||
title: WeCom
|
||||
description: Integrate CowAgent with WeCom (WeChat Work) custom app
|
||||
description: Integrate CowAgent into WeCom enterprise app
|
||||
---
|
||||
|
||||
# WeCom (WeChat Work)
|
||||
|
||||
Integrate CowAgent through a WeCom custom application for internal team messaging.
|
||||
Integrate CowAgent into WeCom through a custom enterprise app, supporting one-on-one chat for internal employees.
|
||||
|
||||
<Note>
|
||||
WeCom only supports Docker deployment or server-based Python deployment, not local running mode.
|
||||
WeCom only supports Docker deployment or server Python deployment. Local run mode is not supported.
|
||||
</Note>
|
||||
|
||||
## 1. Prerequisites
|
||||
|
||||
- A server with a public IP
|
||||
- A WeCom account (individuals can register but cannot be verified)
|
||||
- For verified WeCom accounts, a domain registered to the same entity
|
||||
Required resources:
|
||||
|
||||
## 2. Create a WeCom App
|
||||
1. A server with public IP
|
||||
2. A registered WeCom account (individual registration is possible, but cannot be certified)
|
||||
3. Certified WeCom requires a domain with corresponding entity filing
|
||||
|
||||
1. In the [WeCom Admin Console](https://work.weixin.qq.com/wework_admin/frame#profile), go to **My Enterprise** to get the **Corp ID**
|
||||
2. Go to **App Management**, create a new app, and note the `AgentId` and `Secret`
|
||||
3. Click **Set API Receive**, configure the app interface:
|
||||
- URL format: `http://ip:port/wxcomapp` (verified enterprises need a registered domain)
|
||||
- Generate and save the `Token` and `EncodingAESKey`
|
||||
## 2. Create WeCom App
|
||||
|
||||
## 3. Configuration and Startup
|
||||
1. Get **Corp ID** from **My Enterprise** in [WeCom Admin Console](https://work.weixin.qq.com/wework_admin/frame#profile)
|
||||
2. Switch to **Application Management**, click Create Application, record `AgentId` and `Secret`
|
||||
3. Click **Set API Reception**, configure application interface:
|
||||
- URL format: `http://ip:port/wxcomapp` (certified enterprises must use filed domain)
|
||||
- Generate random `Token` and `EncodingAESKey` and save
|
||||
|
||||
## 3. Configuration and Run
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -41,19 +41,19 @@ Integrate CowAgent through a WeCom custom application for internal team messagin
|
||||
|
||||
| Parameter | Description |
|
||||
| --- | --- |
|
||||
| `wechatcom_corp_id` | Enterprise Corp ID |
|
||||
| `wechatcomapp_token` | Token from API receive config |
|
||||
| `wechatcom_corp_id` | Corp ID |
|
||||
| `wechatcomapp_token` | Token from API reception config |
|
||||
| `wechatcomapp_secret` | App Secret |
|
||||
| `wechatcomapp_agent_id` | App AgentId |
|
||||
| `wechatcomapp_aes_key` | EncodingAESKey from API receive config |
|
||||
| `wechatcomapp_port` | Listening port, default 9898 |
|
||||
| `wechatcomapp_aes_key` | EncodingAESKey from API reception config |
|
||||
| `wechatcomapp_port` | Listen port, default 9898 |
|
||||
|
||||
After starting the program, save the **message server configuration** in the WeCom console, then add the server IP to **Trusted IPs**.
|
||||
After starting the program, return to WeCom Admin Console to save **Message Server Configuration**, and add the server IP to **Enterprise Trusted IPs**.
|
||||
|
||||
<Warning>
|
||||
If configuration fails: 1. Ensure the firewall and security group allow the port; 2. Verify all parameters match; 3. Verified enterprises need a registered domain.
|
||||
If configuration fails: 1. Ensure firewall and security group allow the port; 2. Verify all parameters are consistent; 3. Certified enterprises must configure a filed domain.
|
||||
</Warning>
|
||||
|
||||
## 4. Usage
|
||||
|
||||
Search for the app name in WeCom to start chatting. To allow external WeChat users, share the invitation QR code from **My Enterprise → WeChat Plugin**.
|
||||
Search for the app name in WeCom to start chatting. To allow external WeChat users, share the invite QR code from **My Enterprise → WeChat Plugin**.
|
||||
|
||||
Reference in New Issue
Block a user