Files
chatgpt-on-wechat/docs/zh/configuration.mdx
2026-02-27 12:10:16 +08:00

102 lines
2.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: 配置说明
description: CowAgent 的配置文件详解
---
# 配置说明
配置文件的模板在根目录的 `config-template.json` 中,需复制该模板创建最终生效的 `config.json` 文件:
```bash
cp config-template.json config.json
```
## 核心配置项
```json
{
"channel_type": "web",
"model": "MiniMax-M2.5",
"agent": true,
"agent_workspace": "~/cow",
"agent_max_context_tokens": 40000,
"agent_max_context_turns": 30,
"agent_max_steps": 15
}
```
| 参数 | 说明 | 默认值 |
| --- | --- | --- |
| `channel_type` | 接入渠道类型 | `web` |
| `model` | 模型名称 | `MiniMax-M2.5` |
| `agent` | 是否启用 Agent 模式 | `true` |
| `agent_workspace` | Agent 工作空间路径 | `~/cow` |
| `agent_max_context_tokens` | 最大上下文 tokens | `40000` |
| `agent_max_context_turns` | 最大上下文记忆轮次 | `30` |
| `agent_max_steps` | 单次任务最大决策步数 | `15` |
## 模型 API Key 配置
根据所选模型填写对应的 API Key
```json
{
"minimax_api_key": "",
"zhipu_ai_api_key": "",
"moonshot_api_key": "",
"ark_api_key": "",
"dashscope_api_key": "",
"claude_api_key": "",
"gemini_api_key": "",
"open_ai_api_key": ""
}
```
详细模型配置请参考 [模型说明](/zh/models)。
## 语音配置
```json
{
"speech_recognition": false,
"group_speech_recognition": false,
"voice_reply_voice": false
}
```
| 参数 | 说明 |
| --- | --- |
| `speech_recognition` | 是否开启私聊语音识别 |
| `group_speech_recognition` | 是否开启群组语音识别 |
| `voice_reply_voice` | 是否使用语音回复语音 |
## LinkAI 配置
```json
{
"use_linkai": false,
"linkai_api_key": "",
"linkai_app_code": ""
}
```
| 参数 | 说明 |
| --- | --- |
| `use_linkai` | 是否使用 LinkAI 接口 |
| `linkai_api_key` | LinkAI API Key在 [控制台](https://link-ai.tech/console/interface) 创建 |
| `linkai_app_code` | LinkAI 应用或工作流的 code |
## 代理配置
如需使用网络代理:
```json
{
"proxy": "127.0.0.1:7890"
}
```
<Tip>
全部配置项说明可在项目 [`config.py`](https://github.com/zhayujie/chatgpt-on-wechat/blob/master/config.py) 文件中查看。
</Tip>