docs: init docs

This commit is contained in:
zhayujie
2026-02-27 12:10:16 +08:00
parent 3ddbdd713d
commit d891312032
31 changed files with 2348 additions and 172 deletions

View File

@@ -0,0 +1,40 @@
---
title: DingTalk
description: Integrate CowAgent with DingTalk
---
# DingTalk
Create a smart bot application on the DingTalk Open Platform to integrate CowAgent.
## 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**
## 2. Project Configuration
1. Get `Client ID` and `Client Secret` from **Credentials & Basic Info**
2. Add to `config.json`:
```json
{
"channel_type": "dingtalk",
"dingtalk_client_id": "YOUR_CLIENT_ID",
"dingtalk_client_secret": "YOUR_CLIENT_SECRET"
}
```
3. Install dependency:
```bash
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"
## 3. Usage
Chat with the bot privately or add it to a group chat to start a conversation.

View File

@@ -0,0 +1,69 @@
---
title: Feishu (Lark)
description: Integrate CowAgent with Feishu
---
# Feishu (Lark)
Integrate CowAgent into Feishu by creating a custom app. Supports WebSocket (recommended) and Webhook event modes.
## 1. Create a Custom App
### Create the App
Go to [Feishu Open Platform](https://open.feishu.cn/app/), click **Create Custom App**, and fill in the required information.
### Add Bot Capability
In the **Add App Capabilities** menu, add the **Bot** capability.
### Configure Permissions
Go to **Permission Management**, paste the following permissions, select all, and enable them:
```
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
```
## 2. Project Configuration
Get `App ID` and `App Secret` from **Credentials & Basic Info**, then add to `config.json`:
<Tabs>
<Tab title="WebSocket (Recommended)">
No public IP required:
```json
{
"channel_type": "feishu",
"feishu_app_id": "YOUR_APP_ID",
"feishu_app_secret": "YOUR_APP_SECRET",
"feishu_event_mode": "websocket"
}
```
Install dependency: `pip3 install lark-oapi`
</Tab>
<Tab title="Webhook">
Requires public IP:
```json
{
"channel_type": "feishu",
"feishu_app_id": "YOUR_APP_ID",
"feishu_app_secret": "YOUR_APP_SECRET",
"feishu_token": "VERIFICATION_TOKEN",
"feishu_event_mode": "webhook",
"feishu_port": 9891
}
```
</Tab>
</Tabs>
## 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
Once approved, search for the bot name in Feishu to start chatting.

33
docs/en/channels/web.mdx Normal file
View File

@@ -0,0 +1,33 @@
---
title: Web
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.
## Configuration
```json
{
"channel_type": "web",
"web_port": 9899
}
```
| Parameter | Description | Default |
| --- | --- | --- |
| `channel_type` | Set to `web` | `web` |
| `web_port` | Web service listening port | `9899` |
## Usage
After starting the project, visit:
- Local: `http://localhost:9899/chat`
- Server: `http://<server-ip>:9899/chat`
<Note>
Ensure your server firewall and security group allow access to the configured port.
</Note>

View File

@@ -0,0 +1,58 @@
---
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 |
<Note>
Official Accounts only support server and Docker deployment. Install extended dependencies: `pip3 install -r requirements-optional.txt`
</Note>
## Personal Subscription Account
Add the following to `config.json`:
```json
{
"channel_type": "wechatmp",
"wechatmp_app_id": "YOUR_APP_ID",
"wechatmp_app_secret": "YOUR_APP_SECRET",
"wechatmp_aes_key": "",
"wechatmp_token": "YOUR_TOKEN",
"wechatmp_port": 80
}
```
### Setup Steps
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`
## Enterprise Service Account
The setup is largely identical to the subscription account, with these differences:
1. Register an enterprise service account and complete WeChat verification, ensure **Customer Service API** permission is granted
2. Set `"channel_type": "wechatmp_service"` in `config.json`
3. Replies can be proactively pushed to users without them having to manually retrieve them
```json
{
"channel_type": "wechatmp_service",
"wechatmp_app_id": "YOUR_APP_ID",
"wechatmp_app_secret": "YOUR_APP_SECRET",
"wechatmp_aes_key": "",
"wechatmp_token": "YOUR_TOKEN",
"wechatmp_port": 80
}
```

View File

@@ -0,0 +1,59 @@
---
title: WeCom
description: Integrate CowAgent with WeCom (WeChat Work) custom app
---
# WeCom (WeChat Work)
Integrate CowAgent through a WeCom custom application for internal team messaging.
<Note>
WeCom only supports Docker deployment or server-based Python deployment, not local running mode.
</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
## 2. Create a WeCom App
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`
## 3. Configuration and Startup
```json
{
"channel_type": "wechatcom_app",
"wechatcom_corp_id": "YOUR_CORP_ID",
"wechatcomapp_token": "YOUR_TOKEN",
"wechatcomapp_secret": "YOUR_SECRET",
"wechatcomapp_agent_id": "YOUR_AGENT_ID",
"wechatcomapp_aes_key": "YOUR_AES_KEY",
"wechatcomapp_port": 9898
}
```
| Parameter | Description |
| --- | --- |
| `wechatcom_corp_id` | Enterprise Corp ID |
| `wechatcomapp_token` | Token from API receive config |
| `wechatcomapp_secret` | App Secret |
| `wechatcomapp_agent_id` | App AgentId |
| `wechatcomapp_aes_key` | EncodingAESKey from API receive config |
| `wechatcomapp_port` | Listening port, default 9898 |
After starting the program, save the **message server configuration** in the WeCom console, then add the server IP to **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.
</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**.