mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-06-02 00:57:41 +08:00
feat: support coding plan
This commit is contained in:
35
README.md
35
README.md
@@ -285,13 +285,13 @@ volumes:
|
|||||||
"model": "gpt-5.4",
|
"model": "gpt-5.4",
|
||||||
"open_ai_api_key": "YOUR_API_KEY",
|
"open_ai_api_key": "YOUR_API_KEY",
|
||||||
"open_ai_api_base": "https://api.openai.com/v1",
|
"open_ai_api_base": "https://api.openai.com/v1",
|
||||||
"bot_type": "chatGPT"
|
"bot_type": "openai"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
- `model`: 与OpenAI接口的 [model参数](https://platform.openai.com/docs/models) 一致,支持包括 gpt-5.4、o系列、gpt-4.1等模型,Agent模式推荐使用 `gpt-5.4`
|
- `model`: 与OpenAI接口的 [model参数](https://platform.openai.com/docs/models) 一致,支持包括 gpt-5.4、o系列、gpt-4.1等模型,Agent模式推荐使用 `gpt-5.4`
|
||||||
- `open_ai_api_base`: 如果需要接入第三方代理接口,可通过修改该参数进行接入
|
- `open_ai_api_base`: 如果需要接入第三方代理接口,可通过修改该参数进行接入
|
||||||
- `bot_type`: 使用OpenAI相关模型时无需填写。当使用第三方代理接口接入Claude等非OpenAI官方模型时,该参数设为 `chatGPT`
|
- `bot_type`: 使用OpenAI相关模型时无需填写。当使用第三方代理接口接入Claude等非OpenAI官方模型时,该参数设为 `openai`
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
@@ -332,7 +332,7 @@ volumes:
|
|||||||
方式二:OpenAI兼容方式接入,配置如下:
|
方式二:OpenAI兼容方式接入,配置如下:
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"bot_type": "chatGPT",
|
"bot_type": "openai",
|
||||||
"model": "MiniMax-M2.5",
|
"model": "MiniMax-M2.5",
|
||||||
"open_ai_api_base": "https://api.minimaxi.com/v1",
|
"open_ai_api_base": "https://api.minimaxi.com/v1",
|
||||||
"open_ai_api_key": ""
|
"open_ai_api_key": ""
|
||||||
@@ -361,7 +361,7 @@ volumes:
|
|||||||
方式二:OpenAI兼容方式接入,配置如下:
|
方式二:OpenAI兼容方式接入,配置如下:
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"bot_type": "chatGPT",
|
"bot_type": "openai",
|
||||||
"model": "glm-5",
|
"model": "glm-5",
|
||||||
"open_ai_api_base": "https://open.bigmodel.cn/api/paas/v4",
|
"open_ai_api_base": "https://open.bigmodel.cn/api/paas/v4",
|
||||||
"open_ai_api_key": ""
|
"open_ai_api_key": ""
|
||||||
@@ -390,7 +390,7 @@ volumes:
|
|||||||
方式二:OpenAI兼容方式接入,配置如下:
|
方式二:OpenAI兼容方式接入,配置如下:
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"bot_type": "chatGPT",
|
"bot_type": "openai",
|
||||||
"model": "qwen3.5-plus",
|
"model": "qwen3.5-plus",
|
||||||
"open_ai_api_base": "https://dashscope.aliyuncs.com/compatible-mode/v1",
|
"open_ai_api_base": "https://dashscope.aliyuncs.com/compatible-mode/v1",
|
||||||
"open_ai_api_key": "sk-qVxxxxG"
|
"open_ai_api_key": "sk-qVxxxxG"
|
||||||
@@ -419,7 +419,7 @@ volumes:
|
|||||||
方式二:OpenAI兼容方式接入,配置如下:
|
方式二:OpenAI兼容方式接入,配置如下:
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"bot_type": "chatGPT",
|
"bot_type": "openai",
|
||||||
"model": "kimi-k2.5",
|
"model": "kimi-k2.5",
|
||||||
"open_ai_api_base": "https://api.moonshot.cn/v1",
|
"open_ai_api_base": "https://api.moonshot.cn/v1",
|
||||||
"open_ai_api_key": ""
|
"open_ai_api_key": ""
|
||||||
@@ -490,7 +490,7 @@ API Key创建:在 [控制台](https://aistudio.google.com/app/apikey?hl=zh-cn)
|
|||||||
"model": "deepseek-chat",
|
"model": "deepseek-chat",
|
||||||
"open_ai_api_key": "sk-xxxxxxxxxxx",
|
"open_ai_api_key": "sk-xxxxxxxxxxx",
|
||||||
"open_ai_api_base": "https://api.deepseek.com/v1",
|
"open_ai_api_base": "https://api.deepseek.com/v1",
|
||||||
"bot_type": "chatGPT"
|
"bot_type": "openai"
|
||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -545,7 +545,7 @@ API Key创建:在 [控制台](https://aistudio.google.com/app/apikey?hl=zh-cn)
|
|||||||
方式二:OpenAI兼容方式接入,配置如下:
|
方式二:OpenAI兼容方式接入,配置如下:
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"bot_type": "chatGPT",
|
"bot_type": "openai",
|
||||||
"model": "ERNIE-4.0-Turbo-8K",
|
"model": "ERNIE-4.0-Turbo-8K",
|
||||||
"open_ai_api_base": "https://qianfan.baidubce.com/v2",
|
"open_ai_api_base": "https://qianfan.baidubce.com/v2",
|
||||||
"open_ai_api_key": "bce-v3/ALTxxxxxxd2b"
|
"open_ai_api_key": "bce-v3/ALTxxxxxxd2b"
|
||||||
@@ -581,7 +581,7 @@ API Key创建:在 [控制台](https://aistudio.google.com/app/apikey?hl=zh-cn)
|
|||||||
方式二:OpenAI兼容方式接入,配置如下:
|
方式二:OpenAI兼容方式接入,配置如下:
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"bot_type": "chatGPT",
|
"bot_type": "openai",
|
||||||
"model": "4.0Ultra",
|
"model": "4.0Ultra",
|
||||||
"open_ai_api_base": "https://spark-api-open.xf-yun.com/v1",
|
"open_ai_api_base": "https://spark-api-open.xf-yun.com/v1",
|
||||||
"open_ai_api_key": ""
|
"open_ai_api_key": ""
|
||||||
@@ -613,6 +613,23 @@ API Key创建:在 [控制台](https://aistudio.google.com/app/apikey?hl=zh-cn)
|
|||||||
- `text_to_image`: 图像生成模型,参考[模型列表](https://www.modelscope.cn/models?filter=inference_type&page=1)
|
- `text_to_image`: 图像生成模型,参考[模型列表](https://www.modelscope.cn/models?filter=inference_type&page=1)
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Coding Plan (编程包月套餐)</summary>
|
||||||
|
|
||||||
|
Coding Plan 是各厂商推出的编程包月套餐,所有厂商均可通过 OpenAI 兼容方式接入:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"bot_type": "openai",
|
||||||
|
"model": "模型名称",
|
||||||
|
"open_ai_api_base": "厂商 Coding Plan API Base",
|
||||||
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
目前支持阿里云、MiniMax、智谱GLM、Kimi、火山引擎等厂商,各厂商详细配置请参考 [Coding Plan 文档](https://docs.cowagent.ai/models/coding-plan)。
|
||||||
|
</details>
|
||||||
|
|
||||||
|
|
||||||
## 通道说明
|
## 通道说明
|
||||||
|
|
||||||
|
|||||||
@@ -609,14 +609,14 @@ class AgentStreamExecutor:
|
|||||||
"arguments": ""
|
"arguments": ""
|
||||||
}
|
}
|
||||||
|
|
||||||
if "id" in tc_delta:
|
if tc_delta.get("id"):
|
||||||
tool_calls_buffer[index]["id"] = tc_delta["id"]
|
tool_calls_buffer[index]["id"] = tc_delta["id"]
|
||||||
|
|
||||||
if "function" in tc_delta:
|
if "function" in tc_delta:
|
||||||
func = tc_delta["function"]
|
func = tc_delta["function"]
|
||||||
if "name" in func:
|
if func.get("name"):
|
||||||
tool_calls_buffer[index]["name"] = func["name"]
|
tool_calls_buffer[index]["name"] = func["name"]
|
||||||
if "arguments" in func:
|
if func.get("arguments"):
|
||||||
tool_calls_buffer[index]["arguments"] += func["arguments"]
|
tool_calls_buffer[index]["arguments"] += func["arguments"]
|
||||||
|
|
||||||
# Preserve _gemini_raw_parts for Gemini thoughtSignature round-trip
|
# Preserve _gemini_raw_parts for Gemini thoughtSignature round-trip
|
||||||
@@ -720,9 +720,9 @@ class AgentStreamExecutor:
|
|||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
if retry_count >= max_retries:
|
if retry_count >= max_retries:
|
||||||
logger.error(f"❌ LLM API error after {max_retries} retries: {e}")
|
logger.error(f"❌ LLM API error after {max_retries} retries: {e}", exc_info=True)
|
||||||
else:
|
else:
|
||||||
logger.error(f"❌ LLM call error (non-retryable): {e}")
|
logger.error(f"❌ LLM call error (non-retryable): {e}", exc_info=True)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
# Parse tool calls
|
# Parse tool calls
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ class AgentLLMModel(LLMModel):
|
|||||||
return configured_bot_type
|
return configured_bot_type
|
||||||
|
|
||||||
if not model_name or not isinstance(model_name, str):
|
if not model_name or not isinstance(model_name, str):
|
||||||
return const.CHATGPT
|
return const.OPENAI
|
||||||
if model_name in self._MODEL_BOT_TYPE_MAP:
|
if model_name in self._MODEL_BOT_TYPE_MAP:
|
||||||
return self._MODEL_BOT_TYPE_MAP[model_name]
|
return self._MODEL_BOT_TYPE_MAP[model_name]
|
||||||
if model_name.lower().startswith("minimax") or model_name in ["abab6.5-chat"]:
|
if model_name.lower().startswith("minimax") or model_name in ["abab6.5-chat"]:
|
||||||
@@ -116,11 +116,11 @@ class AgentLLMModel(LLMModel):
|
|||||||
if model_name in [const.MOONSHOT, "moonshot-v1-8k", "moonshot-v1-32k", "moonshot-v1-128k"]:
|
if model_name in [const.MOONSHOT, "moonshot-v1-8k", "moonshot-v1-32k", "moonshot-v1-128k"]:
|
||||||
return const.MOONSHOT
|
return const.MOONSHOT
|
||||||
if model_name in [const.DEEPSEEK_CHAT, const.DEEPSEEK_REASONER]:
|
if model_name in [const.DEEPSEEK_CHAT, const.DEEPSEEK_REASONER]:
|
||||||
return const.CHATGPT
|
return const.OPENAI
|
||||||
for prefix, btype in self._MODEL_PREFIX_MAP:
|
for prefix, btype in self._MODEL_PREFIX_MAP:
|
||||||
if model_name.startswith(prefix):
|
if model_name.startswith(prefix):
|
||||||
return btype
|
return btype
|
||||||
return const.CHATGPT
|
return const.OPENAI
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def bot(self):
|
def bot(self):
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ from voice.factory import create_voice
|
|||||||
class Bridge(object):
|
class Bridge(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.btype = {
|
self.btype = {
|
||||||
"chat": const.CHATGPT,
|
"chat": const.OPENAI,
|
||||||
"voice_to_text": conf().get("voice_to_text", "openai"),
|
"voice_to_text": conf().get("voice_to_text", "openai"),
|
||||||
"text_to_voice": conf().get("text_to_voice", "google"),
|
"text_to_voice": conf().get("text_to_voice", "google"),
|
||||||
"translate": conf().get("translate", "baidu"),
|
"translate": conf().get("translate", "baidu"),
|
||||||
|
|||||||
@@ -992,7 +992,6 @@ let configProviders = {};
|
|||||||
let configApiBases = {};
|
let configApiBases = {};
|
||||||
let configApiKeys = {};
|
let configApiKeys = {};
|
||||||
let configCurrentModel = '';
|
let configCurrentModel = '';
|
||||||
let configHasBotType = false;
|
|
||||||
let cfgProviderValue = '';
|
let cfgProviderValue = '';
|
||||||
let cfgModelValue = '';
|
let cfgModelValue = '';
|
||||||
|
|
||||||
@@ -1052,7 +1051,6 @@ function initConfigView(data) {
|
|||||||
configApiBases = data.api_bases || {};
|
configApiBases = data.api_bases || {};
|
||||||
configApiKeys = data.api_keys || {};
|
configApiKeys = data.api_keys || {};
|
||||||
configCurrentModel = data.model || '';
|
configCurrentModel = data.model || '';
|
||||||
configHasBotType = !!data.has_bot_type;
|
|
||||||
|
|
||||||
const providerEl = document.getElementById('cfg-provider');
|
const providerEl = document.getElementById('cfg-provider');
|
||||||
const providerOpts = Object.entries(configProviders).map(([pid, p]) => ({ value: pid, label: p.label }));
|
const providerOpts = Object.entries(configProviders).map(([pid, p]) => ({ value: pid, label: p.label }));
|
||||||
@@ -1214,8 +1212,10 @@ function saveModelConfig() {
|
|||||||
const updates = { model: model };
|
const updates = { model: model };
|
||||||
const p = configProviders[cfgProviderValue];
|
const p = configProviders[cfgProviderValue];
|
||||||
updates.use_linkai = (cfgProviderValue === 'linkai');
|
updates.use_linkai = (cfgProviderValue === 'linkai');
|
||||||
if (configHasBotType) {
|
if (cfgProviderValue === 'linkai') {
|
||||||
updates.bot_type = (cfgProviderValue === 'linkai') ? '' : cfgProviderValue;
|
updates.bot_type = '';
|
||||||
|
} else {
|
||||||
|
updates.bot_type = cfgProviderValue;
|
||||||
}
|
}
|
||||||
if (p && p.api_base_key) {
|
if (p && p.api_base_key) {
|
||||||
const base = document.getElementById('cfg-api-base').value.trim();
|
const base = document.getElementById('cfg-api-base').value.trim();
|
||||||
|
|||||||
@@ -551,7 +551,7 @@ class ConfigHandler:
|
|||||||
"api_base_default": "https://generativelanguage.googleapis.com",
|
"api_base_default": "https://generativelanguage.googleapis.com",
|
||||||
"models": [const.GEMINI_31_FLASH_LITE_PRE, const.GEMINI_31_PRO_PRE, const.GEMINI_3_FLASH_PRE],
|
"models": [const.GEMINI_31_FLASH_LITE_PRE, const.GEMINI_31_PRO_PRE, const.GEMINI_3_FLASH_PRE],
|
||||||
}),
|
}),
|
||||||
("chatGPT", {
|
("openai", {
|
||||||
"label": "OpenAI",
|
"label": "OpenAI",
|
||||||
"api_key_field": "open_ai_api_key",
|
"api_key_field": "open_ai_api_key",
|
||||||
"api_base_key": "open_ai_api_base",
|
"api_base_key": "open_ai_api_base",
|
||||||
@@ -625,8 +625,7 @@ class ConfigHandler:
|
|||||||
"use_agent": use_agent,
|
"use_agent": use_agent,
|
||||||
"title": title,
|
"title": title,
|
||||||
"model": local_config.get("model", ""),
|
"model": local_config.get("model", ""),
|
||||||
"bot_type": local_config.get("bot_type", ""),
|
"bot_type": "openai" if local_config.get("bot_type") == "chatGPT" else local_config.get("bot_type", ""),
|
||||||
"has_bot_type": "bot_type" in local_config,
|
|
||||||
"use_linkai": bool(local_config.get("use_linkai", False)),
|
"use_linkai": bool(local_config.get("use_linkai", False)),
|
||||||
"channel_type": local_config.get("channel_type", ""),
|
"channel_type": local_config.get("channel_type", ""),
|
||||||
"agent_max_context_tokens": local_config.get("agent_max_context_tokens", 50000),
|
"agent_max_context_tokens": local_config.get("agent_max_context_tokens", 50000),
|
||||||
@@ -671,9 +670,6 @@ class ConfigHandler:
|
|||||||
file_cfg = json.load(f)
|
file_cfg = json.load(f)
|
||||||
else:
|
else:
|
||||||
file_cfg = {}
|
file_cfg = {}
|
||||||
if "bot_type" in applied and "bot_type" not in file_cfg:
|
|
||||||
del applied["bot_type"]
|
|
||||||
local_config.pop("bot_type", None)
|
|
||||||
file_cfg.update(applied)
|
file_cfg.update(applied)
|
||||||
with open(config_path, "w", encoding="utf-8") as f:
|
with open(config_path, "w", encoding="utf-8") as f:
|
||||||
json.dump(file_cfg, f, indent=4, ensure_ascii=False)
|
json.dump(file_cfg, f, indent=4, ensure_ascii=False)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# 厂商类型
|
# 厂商类型
|
||||||
OPEN_AI = "openAI"
|
OPEN_AI = "openAI"
|
||||||
CHATGPT = "chatGPT"
|
OPENAI = "openai"
|
||||||
|
CHATGPT = "chatGPT" # legacy alias for OPENAI, kept for backward compatibility
|
||||||
BAIDU = "baidu"
|
BAIDU = "baidu"
|
||||||
XUNFEI = "xunfei"
|
XUNFEI = "xunfei"
|
||||||
CHATGPTONAZURE = "chatGPTOnAzure"
|
CHATGPTONAZURE = "chatGPTOnAzure"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ available_setting = {
|
|||||||
"proxy": "", # openai使用的代理
|
"proxy": "", # openai使用的代理
|
||||||
# chatgpt模型, 当use_azure_chatgpt为true时,其名称为Azure上model deployment名称
|
# chatgpt模型, 当use_azure_chatgpt为true时,其名称为Azure上model deployment名称
|
||||||
"model": "gpt-3.5-turbo", # 可选择: gpt-4o, pt-4o-mini, gpt-4-turbo, claude-3-sonnet, wenxin, moonshot, qwen-turbo, xunfei, glm-4, minimax, gemini等模型,全部可选模型详见common/const.py文件
|
"model": "gpt-3.5-turbo", # 可选择: gpt-4o, pt-4o-mini, gpt-4-turbo, claude-3-sonnet, wenxin, moonshot, qwen-turbo, xunfei, glm-4, minimax, gemini等模型,全部可选模型详见common/const.py文件
|
||||||
"bot_type": "", # 可选配置,使用兼容openai格式的三方服务时候,需填"chatGPT"。bot具体名称详见common/const.py文件列出的bot_type,如不填根据model名称判断,
|
"bot_type": "", # 可选配置,使用兼容openai格式的三方服务时候,需填"openai"(历史值"chatGPT"仍兼容)。bot具体名称详见common/const.py文件,如不填根据model名称判断
|
||||||
"use_azure_chatgpt": False, # 是否使用azure的chatgpt
|
"use_azure_chatgpt": False, # 是否使用azure的chatgpt
|
||||||
"azure_deployment_id": "", # azure 模型部署名称
|
"azure_deployment_id": "", # azure 模型部署名称
|
||||||
"azure_api_version": "", # azure api版本
|
"azure_api_version": "", # azure api版本
|
||||||
|
|||||||
@@ -80,7 +80,8 @@
|
|||||||
"models/gemini",
|
"models/gemini",
|
||||||
"models/openai",
|
"models/openai",
|
||||||
"models/deepseek",
|
"models/deepseek",
|
||||||
"models/linkai"
|
"models/linkai",
|
||||||
|
"models/coding-plan"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -171,6 +172,7 @@
|
|||||||
"group": "发布记录",
|
"group": "发布记录",
|
||||||
"pages": [
|
"pages": [
|
||||||
"releases/overview",
|
"releases/overview",
|
||||||
|
"releases/v2.0.3",
|
||||||
"releases/v2.0.2",
|
"releases/v2.0.2",
|
||||||
"releases/v2.0.1",
|
"releases/v2.0.1",
|
||||||
"releases/v2.0.0"
|
"releases/v2.0.0"
|
||||||
@@ -224,7 +226,8 @@
|
|||||||
"en/models/gemini",
|
"en/models/gemini",
|
||||||
"en/models/openai",
|
"en/models/openai",
|
||||||
"en/models/deepseek",
|
"en/models/deepseek",
|
||||||
"en/models/linkai"
|
"en/models/linkai",
|
||||||
|
"en/models/coding-plan"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -133,6 +133,28 @@ Supports mainstream model providers. Recommended models for Agent mode:
|
|||||||
|
|
||||||
For detailed configuration of each model, see the [Models documentation](https://docs.cowagent.ai/en/models/index).
|
For detailed configuration of each model, see the [Models documentation](https://docs.cowagent.ai/en/models/index).
|
||||||
|
|
||||||
|
### Coding Plan
|
||||||
|
|
||||||
|
Coding Plan is a monthly subscription package offered by various providers, ideal for high-frequency Agent usage. All providers can be accessed via OpenAI-compatible mode:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"bot_type": "openai",
|
||||||
|
"model": "MODEL_NAME",
|
||||||
|
"open_ai_api_base": "PROVIDER_CODING_PLAN_API_BASE",
|
||||||
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- `bot_type`: Must be `openai`
|
||||||
|
- `model`: Model name supported by the provider
|
||||||
|
- `open_ai_api_base`: Provider's Coding Plan API Base (different from standard pay-as-you-go)
|
||||||
|
- `open_ai_api_key`: Provider's Coding Plan API Key
|
||||||
|
|
||||||
|
> Note: Coding Plan API Base and API Key are usually separate from standard pay-as-you-go ones. Please obtain them from each provider's platform.
|
||||||
|
|
||||||
|
Supported providers include Alibaba Cloud, MiniMax, Zhipu GLM, Kimi, Volcengine, and more. For detailed configuration of each provider, see the [Coding Plan documentation](https://docs.cowagent.ai/en/models/coding-plan).
|
||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
## Channels
|
## Channels
|
||||||
|
|||||||
139
docs/en/models/coding-plan.mdx
Normal file
139
docs/en/models/coding-plan.mdx
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
---
|
||||||
|
title: Coding Plan
|
||||||
|
description: Coding Plan model configuration
|
||||||
|
---
|
||||||
|
|
||||||
|
> Coding Plan is a monthly subscription package offered by various providers, ideal for high-frequency Agent usage. CowAgent supports all Coding Plan providers via OpenAI-compatible mode.
|
||||||
|
|
||||||
|
<Note>
|
||||||
|
Coding Plan API Base and API Key are usually separate from the standard pay-as-you-go ones. Please obtain them from each provider's platform.
|
||||||
|
</Note>
|
||||||
|
|
||||||
|
## General Configuration
|
||||||
|
|
||||||
|
All providers can be accessed via the OpenAI-compatible protocol, and can be quickly configured through the web console. Set the model provider to **OpenAI**, select a custom model and enter the model code, then fill in the corresponding provider's API Base and API Key:
|
||||||
|
|
||||||
|
<img src="https://cdn.link-ai.tech/doc/20260318113134.png" width="800"/>
|
||||||
|
|
||||||
|
You can also configure directly in `config.json`:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"bot_type": "openai",
|
||||||
|
"model": "MODEL_NAME",
|
||||||
|
"open_ai_api_base": "PROVIDER_CODING_PLAN_API_BASE",
|
||||||
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| Parameter | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| `bot_type` | Must be `openai` (OpenAI-compatible mode) |
|
||||||
|
| `model` | Model name supported by the provider |
|
||||||
|
| `open_ai_api_base` | Provider's Coding Plan API Base URL |
|
||||||
|
| `open_ai_api_key` | Provider's Coding Plan API Key |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Alibaba Cloud
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"bot_type": "openai",
|
||||||
|
"model": "qwen3.5-plus",
|
||||||
|
"open_ai_api_base": "https://coding.dashscope.aliyuncs.com/v1",
|
||||||
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| Parameter | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| `model` | `qwen3.5-plus`, `qwen3-max-2026-01-23`, `qwen3-coder-next`, `qwen3-coder-plus`, `glm-5`, `glm-4.7`, `kimi-k2.5`, `MiniMax-M2.5` |
|
||||||
|
| `open_ai_api_base` | `https://coding.dashscope.aliyuncs.com/v1` |
|
||||||
|
| `open_ai_api_key` | Coding Plan specific key (not shared with pay-as-you-go) |
|
||||||
|
|
||||||
|
Reference: [Quick Start](https://help.aliyun.com/zh/model-studio/coding-plan-quickstart?spm=a2c4g.11186623.help-menu-2400256.d_0_2_1.70115203zi5Igc), [Model List](https://help.aliyun.com/zh/model-studio/coding-plan)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## MiniMax
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"bot_type": "openai",
|
||||||
|
"model": "MiniMax-M2.5",
|
||||||
|
"open_ai_api_base": "https://api.minimaxi.com/v1",
|
||||||
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| Parameter | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| `model` | `MiniMax-M2.5`, `MiniMax-M2.5-highspeed`, `MiniMax-M2.1`, `MiniMax-M2` |
|
||||||
|
| `open_ai_api_base` | China: `https://api.minimaxi.com/v1`; Global: `https://api.minimax.io/v1` |
|
||||||
|
| `open_ai_api_key` | Coding Plan specific key (not shared with pay-as-you-go) |
|
||||||
|
|
||||||
|
Reference: [China Key](https://platform.minimaxi.com/docs/coding-plan/quickstart), [Model List](https://platform.minimaxi.com/docs/guides/pricing-coding-plan), [Global Key](https://platform.minimax.io/docs/coding-plan/quickstart)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Zhipu GLM
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"bot_type": "openai",
|
||||||
|
"model": "glm-4.7",
|
||||||
|
"open_ai_api_base": "https://open.bigmodel.cn/api/coding/paas/v4",
|
||||||
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| Parameter | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| `model` | `glm-5`, `glm-4.7`, `glm-4.6`, `glm-4.5`, `glm-4.5-air` |
|
||||||
|
| `open_ai_api_base` | China: `https://open.bigmodel.cn/api/coding/paas/v4`; Global: `https://api.z.ai/api/coding/paas/v4` |
|
||||||
|
| `open_ai_api_key` | Shared with standard API |
|
||||||
|
|
||||||
|
Reference: [China Quick Start](https://docs.bigmodel.cn/cn/coding-plan/quick-start), [Global Quick Start](https://docs.z.ai/devpack/quick-start)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Kimi
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"bot_type": "openai",
|
||||||
|
"model": "kimi-for-coding",
|
||||||
|
"open_ai_api_base": "https://api.kimi.com/coding/v1",
|
||||||
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| Parameter | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| `model` | `kimi-for-coding` |
|
||||||
|
| `open_ai_api_base` | `https://api.kimi.com/coding/v1` |
|
||||||
|
| `open_ai_api_key` | Coding Plan specific key (not shared with pay-as-you-go) |
|
||||||
|
|
||||||
|
Reference: [Key & Docs](https://www.kimi.com/code/docs/)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Volcengine
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"bot_type": "openai",
|
||||||
|
"model": "Doubao-Seed-2.0-Code",
|
||||||
|
"open_ai_api_base": "https://ark.cn-beijing.volces.com/api/coding/v3",
|
||||||
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| Parameter | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| `model` | `Doubao-Seed-2.0-Code`, `Doubao-Seed-2.0-pro`, `Doubao-Seed-2.0-lite`, `Doubao-Seed-Code`, `MiniMax-M2.5`, `Kimi-K2.5`, `GLM-4.7`, `DeepSeek-V3.2` |
|
||||||
|
| `open_ai_api_base` | `https://ark.cn-beijing.volces.com/api/coding/v3` |
|
||||||
|
| `open_ai_api_key` | Shared with standard API |
|
||||||
|
|
||||||
|
Reference: [Quick Start](https://www.volcengine.com/docs/82379/1928261?lang=zh)
|
||||||
@@ -8,7 +8,7 @@ Use OpenAI-compatible configuration:
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"model": "deepseek-chat",
|
"model": "deepseek-chat",
|
||||||
"bot_type": "chatGPT",
|
"bot_type": "openai",
|
||||||
"open_ai_api_key": "YOUR_API_KEY",
|
"open_ai_api_key": "YOUR_API_KEY",
|
||||||
"open_ai_api_base": "https://api.deepseek.com/v1"
|
"open_ai_api_base": "https://api.deepseek.com/v1"
|
||||||
}
|
}
|
||||||
@@ -17,6 +17,6 @@ Use OpenAI-compatible configuration:
|
|||||||
| Parameter | Description |
|
| Parameter | Description |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `model` | `deepseek-chat` (DeepSeek-V3), `deepseek-reasoner` (DeepSeek-R1) |
|
| `model` | `deepseek-chat` (DeepSeek-V3), `deepseek-reasoner` (DeepSeek-R1) |
|
||||||
| `bot_type` | Must be `chatGPT` (OpenAI-compatible mode) |
|
| `bot_type` | Must be `openai` (OpenAI-compatible mode) |
|
||||||
| `open_ai_api_key` | Create at [DeepSeek Platform](https://platform.deepseek.com/api_keys) |
|
| `open_ai_api_key` | Create at [DeepSeek Platform](https://platform.deepseek.com/api_keys) |
|
||||||
| `open_ai_api_base` | DeepSeek platform BASE URL |
|
| `open_ai_api_base` | DeepSeek platform BASE URL |
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ OpenAI-compatible configuration is also supported:
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"bot_type": "chatGPT",
|
"bot_type": "openai",
|
||||||
"model": "glm-5",
|
"model": "glm-5",
|
||||||
"open_ai_api_base": "https://open.bigmodel.cn/api/paas/v4",
|
"open_ai_api_base": "https://open.bigmodel.cn/api/paas/v4",
|
||||||
"open_ai_api_key": "YOUR_API_KEY"
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ CowAgent supports mainstream LLMs from domestic and international providers. Mod
|
|||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Configure the model name and API key in `config.json` according to your chosen model. Each model also supports OpenAI-compatible access by setting `bot_type` to `chatGPT` and configuring `open_ai_api_base` and `open_ai_api_key`.
|
Configure the model name and API key in `config.json` according to your chosen model. Each model also supports OpenAI-compatible access by setting `bot_type` to `openai` and configuring `open_ai_api_base` and `open_ai_api_key`.
|
||||||
|
|
||||||
You can also use the [LinkAI](https://link-ai.tech) platform interface to flexibly switch between multiple models with support for knowledge base, workflows, and other Agent capabilities.
|
You can also use the [LinkAI](https://link-ai.tech) platform interface to flexibly switch between multiple models with support for knowledge base, workflows, and other Agent capabilities.
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ OpenAI-compatible configuration is also supported:
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"bot_type": "chatGPT",
|
"bot_type": "openai",
|
||||||
"model": "kimi-k2.5",
|
"model": "kimi-k2.5",
|
||||||
"open_ai_api_base": "https://api.moonshot.cn/v1",
|
"open_ai_api_base": "https://api.moonshot.cn/v1",
|
||||||
"open_ai_api_key": "YOUR_API_KEY"
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ OpenAI-compatible configuration is also supported:
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"bot_type": "chatGPT",
|
"bot_type": "openai",
|
||||||
"model": "MiniMax-M2.5",
|
"model": "MiniMax-M2.5",
|
||||||
"open_ai_api_base": "https://api.minimaxi.com/v1",
|
"open_ai_api_base": "https://api.minimaxi.com/v1",
|
||||||
"open_ai_api_key": "YOUR_API_KEY"
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
|||||||
@@ -16,4 +16,4 @@ description: OpenAI model configuration
|
|||||||
| `model` | Matches the [model parameter](https://platform.openai.com/docs/models) of the OpenAI API. Supports o-series, gpt-5.4, gpt-5 series, gpt-4.1, etc. Recommended for Agent mode: `gpt-5.4` |
|
| `model` | Matches the [model parameter](https://platform.openai.com/docs/models) of the OpenAI API. Supports o-series, gpt-5.4, gpt-5 series, gpt-4.1, etc. Recommended for Agent mode: `gpt-5.4` |
|
||||||
| `open_ai_api_key` | Create at [OpenAI Platform](https://platform.openai.com/api-keys) |
|
| `open_ai_api_key` | Create at [OpenAI Platform](https://platform.openai.com/api-keys) |
|
||||||
| `open_ai_api_base` | Optional. Change to use third-party proxy |
|
| `open_ai_api_base` | Optional. Change to use third-party proxy |
|
||||||
| `bot_type` | Not required for official OpenAI models. Set to `chatGPT` when using Claude or other non-OpenAI models via proxy |
|
| `bot_type` | Not required for official OpenAI models. Set to `openai` when using Claude or other non-OpenAI models via proxy |
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ OpenAI-compatible configuration is also supported:
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"bot_type": "chatGPT",
|
"bot_type": "openai",
|
||||||
"model": "qwen3.5-plus",
|
"model": "qwen3.5-plus",
|
||||||
"open_ai_api_base": "https://dashscope.aliyuncs.com/compatible-mode/v1",
|
"open_ai_api_base": "https://dashscope.aliyuncs.com/compatible-mode/v1",
|
||||||
"open_ai_api_key": "YOUR_API_KEY"
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
|||||||
140
docs/models/coding-plan.mdx
Normal file
140
docs/models/coding-plan.mdx
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
---
|
||||||
|
title: Coding Plan
|
||||||
|
description: Coding Plan 模式模型配置
|
||||||
|
---
|
||||||
|
|
||||||
|
> Coding Plan 是各厂商推出的编程包月套餐,适合高频使用 Agent 的场景。CowAgent 支持通过 OpenAI 兼容方式接入各厂商的 Coding Plan 接口。
|
||||||
|
|
||||||
|
<Note>
|
||||||
|
Coding Plan 的 API Base 和 API Key 通常与普通按量计费接口不通用,请在各厂商平台单独获取。
|
||||||
|
</Note>
|
||||||
|
|
||||||
|
## 通用配置格式
|
||||||
|
|
||||||
|
所有厂商均可使用 OpenAI 兼容协议接入,可在web控制台快速配置。设置模型厂商为**OpenAI**,选择自定义模型并填入模型编码,最后填写对应厂商的API Base 和 API Key:
|
||||||
|
|
||||||
|
<img src="https://cdn.link-ai.tech/doc/20260318113134.png" width="800"/>
|
||||||
|
|
||||||
|
也可通过 `config.json` 配置文件直接修改:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"bot_type": "openai",
|
||||||
|
"model": "模型名称",
|
||||||
|
"open_ai_api_base": "厂商 Coding Plan API Base",
|
||||||
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| 参数 | 说明 |
|
||||||
|
| --- | --- |
|
||||||
|
| `bot_type` | 固定为 `openai`(OpenAI 兼容方式) |
|
||||||
|
| `model` | 各厂商支持的模型名称 |
|
||||||
|
| `open_ai_api_base` | 各厂商 Coding Plan 专用 API Base |
|
||||||
|
| `open_ai_api_key` | 各厂商 Coding Plan 专用 API Key |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 阿里云
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"bot_type": "openai",
|
||||||
|
"model": "qwen3.5-plus",
|
||||||
|
"open_ai_api_base": "https://coding.dashscope.aliyuncs.com/v1",
|
||||||
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| 参数 | 说明 |
|
||||||
|
| --- | --- |
|
||||||
|
| `model` | `qwen3.5-plus`、`qwen3-max-2026-01-23`、`qwen3-coder-next`、`qwen3-coder-plus`、`glm-5`、`glm-4.7`、`kimi-k2.5`、`MiniMax-M2.5` |
|
||||||
|
| `open_ai_api_base` | `https://coding.dashscope.aliyuncs.com/v1` |
|
||||||
|
| `open_ai_api_key` | Coding Plan 专用 Key(与按量计费接口不通用) |
|
||||||
|
|
||||||
|
官方文档:[快速开始](https://help.aliyun.com/zh/model-studio/coding-plan-quickstart?spm=a2c4g.11186623.help-menu-2400256.d_0_2_1.70115203zi5Igc)、[模型列表](https://help.aliyun.com/zh/model-studio/coding-plan)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## MiniMax
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"bot_type": "openai",
|
||||||
|
"model": "MiniMax-M2.5",
|
||||||
|
"open_ai_api_base": "https://api.minimaxi.com/v1",
|
||||||
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| 参数 | 说明 |
|
||||||
|
| --- | --- |
|
||||||
|
| `model` | `MiniMax-M2.5`、`MiniMax-M2.5-highspeed`、`MiniMax-M2.1`、`MiniMax-M2` |
|
||||||
|
| `open_ai_api_base` | 国内:`https://api.minimaxi.com/v1`;海外:`https://api.minimax.io/v1` |
|
||||||
|
| `open_ai_api_key` | Coding Plan 专用 Key(与按量计费接口不通用) |
|
||||||
|
|
||||||
|
官方文档:[国内 Key 获取](https://platform.minimaxi.com/docs/coding-plan/quickstart)、[模型列表](https://platform.minimaxi.com/docs/guides/pricing-coding-plan)、[国际 Key 获取](https://platform.minimax.io/docs/coding-plan/quickstart)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
## 智谱 GLM
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"bot_type": "openai",
|
||||||
|
"model": "glm-4.7",
|
||||||
|
"open_ai_api_base": "https://open.bigmodel.cn/api/coding/paas/v4",
|
||||||
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| 参数 | 说明 |
|
||||||
|
| --- | --- |
|
||||||
|
| `model` | `glm-5`、`glm-4.7`、`glm-4.6`、`glm-4.5`、`glm-4.5-air` |
|
||||||
|
| `open_ai_api_base` | 中国区:`https://open.bigmodel.cn/api/coding/paas/v4`;全球区:`https://api.z.ai/api/coding/paas/v4` |
|
||||||
|
| `open_ai_api_key` | API Key 与普通接口通用 |
|
||||||
|
|
||||||
|
官方文档:[国内版快速开始](https://docs.bigmodel.cn/cn/coding-plan/quick-start)、[国际版快速开始](https://docs.z.ai/devpack/quick-start)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Kimi
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"bot_type": "openai",
|
||||||
|
"model": "kimi-for-coding",
|
||||||
|
"open_ai_api_base": "https://api.kimi.com/coding/v1",
|
||||||
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| 参数 | 说明 |
|
||||||
|
| --- | --- |
|
||||||
|
| `model` | `kimi-for-coding` |
|
||||||
|
| `open_ai_api_base` | `https://api.kimi.com/coding/v1` |
|
||||||
|
| `open_ai_api_key` | Coding Plan 专用 Key(与按量计费接口不通用) |
|
||||||
|
|
||||||
|
官方文档:[Key 获取](https://www.kimi.com/code/docs/)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 火山引擎
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"bot_type": "openai",
|
||||||
|
"model": "Doubao-Seed-2.0-Code",
|
||||||
|
"open_ai_api_base": "https://ark.cn-beijing.volces.com/api/coding/v3",
|
||||||
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| 参数 | 说明 |
|
||||||
|
| --- | --- |
|
||||||
|
| `model` | `Doubao-Seed-2.0-Code`、`Doubao-Seed-2.0-pro`、`Doubao-Seed-2.0-lite`、`Doubao-Seed-Code`、`MiniMax-M2.5`、`Kimi-K2.5`、`GLM-4.7`、`DeepSeek-V3.2` |
|
||||||
|
| `open_ai_api_base` | `https://ark.cn-beijing.volces.com/api/coding/v3` |
|
||||||
|
| `open_ai_api_key` | API Key 与普通接口通用 |
|
||||||
|
|
||||||
|
官方文档:[快速开始](https://www.volcengine.com/docs/82379/1928261?lang=zh)
|
||||||
@@ -10,13 +10,13 @@ description: DeepSeek 模型配置
|
|||||||
"model": "deepseek-chat",
|
"model": "deepseek-chat",
|
||||||
"open_ai_api_key": "YOUR_API_KEY",
|
"open_ai_api_key": "YOUR_API_KEY",
|
||||||
"open_ai_api_base": "https://api.deepseek.com/v1",
|
"open_ai_api_base": "https://api.deepseek.com/v1",
|
||||||
"bot_type": "chatGPT"
|
"bot_type": "openai"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
| 参数 | 说明 |
|
| 参数 | 说明 |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `model` | `deepseek-chat`(DeepSeek-V3)、`deepseek-reasoner`(DeepSeek-R1) |
|
| `model` | `deepseek-chat`(DeepSeek-V3)、`deepseek-reasoner`(DeepSeek-R1) |
|
||||||
| `bot_type` | 固定为 `chatGPT`(OpenAI 兼容方式) |
|
| `bot_type` | 固定为 `openai`(OpenAI 兼容方式) |
|
||||||
| `open_ai_api_key` | 在 [DeepSeek 平台](https://platform.deepseek.com/api_keys) 创建 |
|
| `open_ai_api_key` | 在 [DeepSeek 平台](https://platform.deepseek.com/api_keys) 创建 |
|
||||||
| `open_ai_api_base` | DeepSeek 平台 BASE URL |
|
| `open_ai_api_base` | DeepSeek 平台 BASE URL |
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ description: 智谱AI GLM 模型配置
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"bot_type": "chatGPT",
|
"bot_type": "openai",
|
||||||
"model": "glm-5",
|
"model": "glm-5",
|
||||||
"open_ai_api_base": "https://open.bigmodel.cn/api/paas/v4",
|
"open_ai_api_base": "https://open.bigmodel.cn/api/paas/v4",
|
||||||
"open_ai_api_key": "YOUR_API_KEY"
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
|||||||
@@ -11,9 +11,13 @@ CowAgent 支持国内外主流厂商的大语言模型,模型接口实现在
|
|||||||
|
|
||||||
## 配置方式
|
## 配置方式
|
||||||
|
|
||||||
根据所选模型,在 `config.json` 中填写对应的模型名称和 API Key 即可。每个模型也支持 OpenAI 兼容方式接入,将 `bot_type` 设为 `chatGPT`,配置 `open_ai_api_base` 和 `open_ai_api_key`。
|
根据所选模型,在 `config.json` 中填写对应的模型名称和 API Key 即可。每个模型也支持 OpenAI 兼容方式接入,将 `bot_type` 设为 `openai`,配置 `open_ai_api_base` 和 `open_ai_api_key`。
|
||||||
|
|
||||||
同时支持使用 [LinkAI](https://link-ai.tech) 平台接口,可灵活切换多种模型并支持知识库、工作流等 Agent 能力。
|
同时支持使用 [LinkAI](https://link-ai.tech) 平台接口,可灵活切换多种模型,并支持知识库、工作流、插件等 Agent 能力。
|
||||||
|
|
||||||
|
也可以通过 [Web 控制台](/channels/web) 在线管理模型配置,无需手动编辑配置文件:
|
||||||
|
|
||||||
|
<img width="850" src="https://cdn.link-ai.tech/doc/20260227173811.png" />
|
||||||
|
|
||||||
## 支持的模型
|
## 支持的模型
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ description: Kimi (Moonshot) 模型配置
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"bot_type": "chatGPT",
|
"bot_type": "openai",
|
||||||
"model": "kimi-k2.5",
|
"model": "kimi-k2.5",
|
||||||
"open_ai_api_base": "https://api.moonshot.cn/v1",
|
"open_ai_api_base": "https://api.moonshot.cn/v1",
|
||||||
"open_ai_api_key": "YOUR_API_KEY"
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ description: MiniMax 模型配置
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"bot_type": "chatGPT",
|
"bot_type": "openai",
|
||||||
"model": "MiniMax-M2.5",
|
"model": "MiniMax-M2.5",
|
||||||
"open_ai_api_base": "https://api.minimaxi.com/v1",
|
"open_ai_api_base": "https://api.minimaxi.com/v1",
|
||||||
"open_ai_api_key": "YOUR_API_KEY"
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
|||||||
@@ -16,4 +16,4 @@ description: OpenAI 模型配置
|
|||||||
| `model` | 与 OpenAI 接口的 [model 参数](https://platform.openai.com/docs/models) 一致,支持 o 系列、gpt-5.4、gpt-5 系列、gpt-4.1 等,Agent 模式推荐使用 `gpt-5.4` |
|
| `model` | 与 OpenAI 接口的 [model 参数](https://platform.openai.com/docs/models) 一致,支持 o 系列、gpt-5.4、gpt-5 系列、gpt-4.1 等,Agent 模式推荐使用 `gpt-5.4` |
|
||||||
| `open_ai_api_key` | 在 [OpenAI 平台](https://platform.openai.com/api-keys) 创建 |
|
| `open_ai_api_key` | 在 [OpenAI 平台](https://platform.openai.com/api-keys) 创建 |
|
||||||
| `open_ai_api_base` | 可选,修改可接入第三方代理接口 |
|
| `open_ai_api_base` | 可选,修改可接入第三方代理接口 |
|
||||||
| `bot_type` | 使用 OpenAI 官方模型时无需填写。当通过代理接口使用 Claude 等非 OpenAI 模型时,设为 `chatGPT` |
|
| `bot_type` | 使用 OpenAI 官方模型时无需填写。当通过代理接口使用 Claude 等非 OpenAI 模型时,设为 `openai` |
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ description: 通义千问模型配置
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"bot_type": "chatGPT",
|
"bot_type": "openai",
|
||||||
"model": "qwen3.5-plus",
|
"model": "qwen3.5-plus",
|
||||||
"open_ai_api_base": "https://dashscope.aliyuncs.com/compatible-mode/v1",
|
"open_ai_api_base": "https://dashscope.aliyuncs.com/compatible-mode/v1",
|
||||||
"open_ai_api_key": "YOUR_API_KEY"
|
"open_ai_api_key": "YOUR_API_KEY"
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ description: CowAgent 版本更新历史
|
|||||||
|
|
||||||
| 版本 | 日期 | 说明 |
|
| 版本 | 日期 | 说明 |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
|
| [2.0.3](/releases/v2.0.3) | 2026.03.18 | 新增企微智能机器人和 QQ 通道、Web 控制台文件处理、记忆系统升级 |
|
||||||
| [2.0.2](/releases/v2.0.2) | 2026.02.27 | Web 控制台升级、多通道同时运行、会话持久化 |
|
| [2.0.2](/releases/v2.0.2) | 2026.02.27 | Web 控制台升级、多通道同时运行、会话持久化 |
|
||||||
| [2.0.1](/releases/v2.0.1) | 2026.02.13 | 内置 Web Search 工具、智能上下文管理、多项修复 |
|
| [2.0.1](/releases/v2.0.1) | 2026.02.13 | 内置 Web Search 工具、智能上下文管理、多项修复 |
|
||||||
| [2.0.0](/releases/v2.0.0) | 2026.02.03 | 全面升级为超级 Agent 助理 |
|
| [2.0.0](/releases/v2.0.0) | 2026.02.03 | 全面升级为超级 Agent 助理 |
|
||||||
|
|||||||
79
docs/releases/v2.0.3.mdx
Normal file
79
docs/releases/v2.0.3.mdx
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
---
|
||||||
|
title: v2.0.3
|
||||||
|
description: CowAgent 2.0.3 - 新增企微智能机器人和 QQ 通道、Web 控制台文件处理、记忆系统升级
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔌 新增接入通道
|
||||||
|
|
||||||
|
### 企业微信智能机器人
|
||||||
|
|
||||||
|
新增企业微信智能机器人(`wecom_bot`)通道,支持流式卡片消息输出,支持文本和图片消息的接收与回复,可在 Web 控制台中进行通道配置和管理。
|
||||||
|
|
||||||
|
接入文档:[企微智能机器人接入](/channels/wecom-bot)。
|
||||||
|
|
||||||
|
相关提交:[d4480b6](https://github.com/zhayujie/chatgpt-on-wechat/commit/d4480b6), [a42f31f](https://github.com/zhayujie/chatgpt-on-wechat/commit/a42f31f), [4ecd4df](https://github.com/zhayujie/chatgpt-on-wechat/commit/4ecd4df), [8b45d6c](https://github.com/zhayujie/chatgpt-on-wechat/commit/8b45d6c)
|
||||||
|
|
||||||
|
### QQ 通道
|
||||||
|
|
||||||
|
新增 QQ 官方机器人(`qq`)通道,支持文本和图片消息的接收与回复,支持私聊和群聊场景。
|
||||||
|
|
||||||
|
接入文档参考: [QQ机器人接入](/channels/qq)。
|
||||||
|
|
||||||
|
相关提交:[005a0e1](https://github.com/zhayujie/chatgpt-on-wechat/commit/005a0e1), [a4d54f5](https://github.com/zhayujie/chatgpt-on-wechat/commit/a4d54f5)
|
||||||
|
|
||||||
|
## 🖥️ Web 控制台支持文件输入和处理
|
||||||
|
|
||||||
|
Web 控制台对话界面支持文件和图片上传,可直接发送文件给 Agent 进行处理。同时 Read 工具新增对 Office 文档(Word、Excel、PPT)的解析能力。
|
||||||
|
|
||||||
|
相关提交:[30c6d9b](https://github.com/zhayujie/chatgpt-on-wechat/commit/30c6d9b)
|
||||||
|
|
||||||
|
## 🤖 新增模型
|
||||||
|
|
||||||
|
- **GPT-5.4**:新增 `gpt-5.4` 模型支持 ([1623deb](https://github.com/zhayujie/chatgpt-on-wechat/commit/1623deb))
|
||||||
|
- **Gemini 3.1 Flash Lite Preview**:新增 `gemini-3.1-flash-lite-preview` 模型支持 ([ba915f2](https://github.com/zhayujie/chatgpt-on-wechat/commit/ba915f2))
|
||||||
|
|
||||||
|
## 💰 Coding Plan 支持
|
||||||
|
|
||||||
|
新增各厂商 Coding Plan(编程包月套餐)的接入支持,通过 OpenAI 兼容方式统一接入。目前已支持阿里云、MiniMax、智谱 GLM、Kimi、火山引擎等厂商。
|
||||||
|
|
||||||
|
详细配置参考 [Coding Plan 文档](/models/coding-plan)。
|
||||||
|
|
||||||
|
## 🧠 记忆系统升级
|
||||||
|
|
||||||
|
记忆冲刷(Memory Flush)系统全面升级:
|
||||||
|
|
||||||
|
- 使用 LLM 对超出上下文窗口的对话内容进行智能摘要,生成精炼的每日记忆条目
|
||||||
|
- 摘要在后台线程异步执行,不阻塞回复
|
||||||
|
- 优化上下文批量裁剪策略,降低冲刷频率
|
||||||
|
- 新增每日定时冲刷兜底机制,避免低活跃场景下记忆丢失
|
||||||
|
- 修复上下文记忆丢失问题
|
||||||
|
|
||||||
|
相关提交:[022c13f](https://github.com/zhayujie/chatgpt-on-wechat/commit/022c13f), [c116235](https://github.com/zhayujie/chatgpt-on-wechat/commit/c116235)
|
||||||
|
|
||||||
|
## 🔧 工具重构
|
||||||
|
|
||||||
|
- **图片识别**:将图片识别(Image Vision)从 Skill 重构为内置 Tool,新增独立的图片视觉提供方(Vision Provider)配置,提升稳定性和可维护性 ([a50fafa](https://github.com/zhayujie/chatgpt-on-wechat/commit/a50fafa), [3b8b562](https://github.com/zhayujie/chatgpt-on-wechat/commit/3b8b562))
|
||||||
|
- **网页抓取**:将网页抓取(Web Fetch)从 Skill 重构为内置 Tool,支持远程文档文件(PDF、Word、Excel、PPT)的下载和解析 ([ccb9030](https://github.com/zhayujie/chatgpt-on-wechat/commit/ccb9030), [fa61744](https://github.com/zhayujie/chatgpt-on-wechat/commit/fa61744))
|
||||||
|
|
||||||
|
## ⚡ 性能优化
|
||||||
|
|
||||||
|
- **启动加速**:飞书通道采用懒加载方式导入依赖,避免 4-10 秒的启动延迟 ([924dc79](https://github.com/zhayujie/chatgpt-on-wechat/commit/924dc79))
|
||||||
|
- **通道稳定性**:优化通道连接稳定性,支持通道配置通过环境变量设置 ([f1c04bc](https://github.com/zhayujie/chatgpt-on-wechat/commit/f1c04bc), [46d97fd](https://github.com/zhayujie/chatgpt-on-wechat/commit/46d97fd))
|
||||||
|
|
||||||
|
## 🐛 问题修复
|
||||||
|
|
||||||
|
- **bot_type 配置**:修复 Agent 模式下 `bot_type` 配置传递问题 ([36d54ca](https://github.com/zhayujie/chatgpt-on-wechat/commit/36d54ca)) ([#2691](https://github.com/zhayujie/chatgpt-on-wechat/pull/2691)) Thanks [@Weikjssss](https://github.com/Weikjssss)
|
||||||
|
- **bot_type 优先级**:调整 Agent 模式下 `bot_type` 的解析优先级 ([d0a70d3](https://github.com/zhayujie/chatgpt-on-wechat/commit/d0a70d3)) ([#2692](https://github.com/zhayujie/chatgpt-on-wechat/pull/2692)) Thanks [@6vision](https://github.com/6vision)
|
||||||
|
- **智谱模型配置**:修复智谱 `bot_type` 命名、Web 控制台持久化及正则转义问题 ([c4a93b7](https://github.com/zhayujie/chatgpt-on-wechat/commit/c4a93b7)) ([#2693](https://github.com/zhayujie/chatgpt-on-wechat/pull/2693)) Thanks [@6vision](https://github.com/6vision)
|
||||||
|
- **OpenAI 兼容层**:使用 `openai_compat` 层统一错误处理 ([f1e888f](https://github.com/zhayujie/chatgpt-on-wechat/commit/f1e888f)) ([#2688](https://github.com/zhayujie/chatgpt-on-wechat/pull/2688)) Thanks [@JasonOA888](https://github.com/JasonOA888)
|
||||||
|
- **OpenAI 兼容迁移**:完成所有模型 Bot 的 `openai_compat` 迁移 ([d5d0b94](https://github.com/zhayujie/chatgpt-on-wechat/commit/d5d0b94)) ([#2689](https://github.com/zhayujie/chatgpt-on-wechat/pull/2689))
|
||||||
|
- **Gemini 工具调用**:修复 Gemini 模型的工具调用匹配问题 ([eda82ba](https://github.com/zhayujie/chatgpt-on-wechat/commit/eda82ba))
|
||||||
|
- **会话并发**:修复会话并发场景下的竞态条件问题 ([9879878](https://github.com/zhayujie/chatgpt-on-wechat/commit/9879878))
|
||||||
|
- **历史消息恢复**:修复历史会话消息不完整问题,仅恢复 user/assistant 文本消息,剥离工具调用 ([b788a3d](https://github.com/zhayujie/chatgpt-on-wechat/commit/b788a3d), [a33ce97](https://github.com/zhayujie/chatgpt-on-wechat/commit/a33ce97))
|
||||||
|
- **飞书群聊**:移除飞书群聊场景下对 `bot_name` 的依赖 ([b641bff](https://github.com/zhayujie/chatgpt-on-wechat/commit/b641bff))
|
||||||
|
- **Safari 兼容**:修复 Safari 浏览器 IME 回车键误触发消息发送问题 ([0687916](https://github.com/zhayujie/chatgpt-on-wechat/commit/0687916))
|
||||||
|
- **Windows 兼容**:修复 Windows 下 bash 风格 `$VAR` 环境变量转换为 `%VAR%` 的问题 ([7c67513](https://github.com/zhayujie/chatgpt-on-wechat/commit/7c67513))
|
||||||
|
- **MiniMax 参数**:增加 MiniMax 模型的 `max_tokens` 限制 ([1767413](https://github.com/zhayujie/chatgpt-on-wechat/commit/1767413))
|
||||||
|
- **.gitignore 更新**:添加 Python 目录忽略规则 ([9318138](https://github.com/zhayujie/chatgpt-on-wechat/commit/9318138)) ([#2683](https://github.com/zhayujie/chatgpt-on-wechat/pull/2683)) Thanks [@pelioo](https://github.com/pelioo)
|
||||||
|
|
||||||
|
**发布日期**:2026.03.18 | [Full Changelog](https://github.com/zhayujie/chatgpt-on-wechat/compare/2.0.2...master)
|
||||||
@@ -17,7 +17,7 @@ def create_bot(bot_type):
|
|||||||
from models.baidu.baidu_wenxin import BaiduWenxinBot
|
from models.baidu.baidu_wenxin import BaiduWenxinBot
|
||||||
return BaiduWenxinBot()
|
return BaiduWenxinBot()
|
||||||
|
|
||||||
elif bot_type in (const.CHATGPT, const.DEEPSEEK): # DeepSeek uses OpenAI-compatible API
|
elif bot_type in (const.OPENAI, const.CHATGPT, const.DEEPSEEK): # OpenAI-compatible API
|
||||||
from models.chatgpt.chat_gpt_bot import ChatGPTBot
|
from models.chatgpt.chat_gpt_bot import ChatGPTBot
|
||||||
return ChatGPTBot()
|
return ChatGPTBot()
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class Dungeon(Plugin):
|
|||||||
if e_context["context"].type != ContextType.TEXT:
|
if e_context["context"].type != ContextType.TEXT:
|
||||||
return
|
return
|
||||||
bottype = Bridge().get_bot_type("chat")
|
bottype = Bridge().get_bot_type("chat")
|
||||||
if bottype not in [const.OPEN_AI, const.CHATGPT, const.CHATGPTONAZURE, const.LINKAI]:
|
if bottype not in [const.OPEN_AI, const.OPENAI, const.CHATGPT, const.CHATGPTONAZURE, const.LINKAI]:
|
||||||
return
|
return
|
||||||
bot = Bridge().get_bot("chat")
|
bot = Bridge().get_bot("chat")
|
||||||
content = e_context["context"].content[:]
|
content = e_context["context"].content[:]
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ class Godcmd(Plugin):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
ok, result = False, "你没有设置私有GPT模型"
|
ok, result = False, "你没有设置私有GPT模型"
|
||||||
elif cmd == "reset":
|
elif cmd == "reset":
|
||||||
if bottype in [const.OPEN_AI, const.CHATGPT, const.CHATGPTONAZURE, const.LINKAI, const.BAIDU, const.XUNFEI, const.QWEN, const.GEMINI, const.ZHIPU_AI, const.CLAUDEAPI]:
|
if bottype in [const.OPEN_AI, const.OPENAI, const.CHATGPT, const.CHATGPTONAZURE, const.LINKAI, const.BAIDU, const.XUNFEI, const.QWEN, const.GEMINI, const.ZHIPU_AI, const.CLAUDEAPI]:
|
||||||
bot.sessions.clear_session(session_id)
|
bot.sessions.clear_session(session_id)
|
||||||
if Bridge().chat_bots.get(bottype):
|
if Bridge().chat_bots.get(bottype):
|
||||||
Bridge().chat_bots.get(bottype).sessions.clear_session(session_id)
|
Bridge().chat_bots.get(bottype).sessions.clear_session(session_id)
|
||||||
@@ -340,7 +340,7 @@ class Godcmd(Plugin):
|
|||||||
load_config()
|
load_config()
|
||||||
ok, result = True, "配置已重载"
|
ok, result = True, "配置已重载"
|
||||||
elif cmd == "resetall":
|
elif cmd == "resetall":
|
||||||
if bottype in [const.OPEN_AI, const.CHATGPT, const.CHATGPTONAZURE, const.LINKAI,
|
if bottype in [const.OPEN_AI, const.OPENAI, const.CHATGPT, const.CHATGPTONAZURE, const.LINKAI,
|
||||||
const.BAIDU, const.XUNFEI, const.QWEN, const.GEMINI, const.ZHIPU_AI, const.MOONSHOT,
|
const.BAIDU, const.XUNFEI, const.QWEN, const.GEMINI, const.ZHIPU_AI, const.MOONSHOT,
|
||||||
const.MODELSCOPE]:
|
const.MODELSCOPE]:
|
||||||
channel.cancel_all_session()
|
channel.cancel_all_session()
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ class Role(Plugin):
|
|||||||
if e_context["context"].type != ContextType.TEXT:
|
if e_context["context"].type != ContextType.TEXT:
|
||||||
return
|
return
|
||||||
btype = Bridge().get_bot_type("chat")
|
btype = Bridge().get_bot_type("chat")
|
||||||
if btype not in [const.OPEN_AI, const.CHATGPT, const.CHATGPTONAZURE, const.QWEN_DASHSCOPE, const.XUNFEI, const.BAIDU, const.ZHIPU_AI, const.MOONSHOT, const.MiniMax, const.LINKAI,const.MODELSCOPE]:
|
if btype not in [const.OPEN_AI, const.OPENAI, const.CHATGPT, const.CHATGPTONAZURE, const.QWEN_DASHSCOPE, const.XUNFEI, const.BAIDU, const.ZHIPU_AI, const.MOONSHOT, const.MiniMax, const.LINKAI, const.MODELSCOPE]:
|
||||||
logger.debug(f'不支持的bot: {btype}')
|
logger.debug(f'不支持的bot: {btype}')
|
||||||
return
|
return
|
||||||
bot = Bridge().get_bot("chat")
|
bot = Bridge().get_bot("chat")
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ class Tool(Plugin):
|
|||||||
|
|
||||||
# 暂时不支持未来扩展的bot
|
# 暂时不支持未来扩展的bot
|
||||||
if Bridge().get_bot_type("chat") not in (
|
if Bridge().get_bot_type("chat") not in (
|
||||||
|
const.OPENAI,
|
||||||
const.CHATGPT,
|
const.CHATGPT,
|
||||||
const.OPEN_AI,
|
const.OPEN_AI,
|
||||||
const.CHATGPTONAZURE,
|
const.CHATGPTONAZURE,
|
||||||
|
|||||||
Reference in New Issue
Block a user