cURL
Authorizations
string
header
required
DashScope API Key,在控制台 API Key 页面(https://bailian.console.aliyun.com/settings/apikey)获取。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
更新 Agent 的名称、描述或草稿配置
curl -X POST "https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/indices/rag/agent/update" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "aid-8f3a1b2c4d5e6f70",
"agent_name": "客服知识问答助手 v2",
"agent_config": {
"agent_policy": "agentic",
"agent_model": "qwen-max-latest",
"enable_session_file": "false",
"enable_refusal": "true",
"enable_anti_leak": "true",
"enable_rich_text": "false",
"enable_citation": "true",
"temperature": 0.7,
"max_num_llm_calls": 10,
"kb_search_configs": [
{
"id": "pipeline-xxxxxx",
"weight": 1,
"dense_similarity_top_k": 15,
"rerank_top_n": 5,
"rerank": {
"model_name": "gte-rerank-hybrid",
"rerank_mode": "custom",
"rerank_instruct": "根据用户问题的技术领域对文档进行相关性排序"
}
}
]
}
}'{
"request_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"status_code": 200,
"code": "Success",
"message": "",
"status": "SUCCESS",
"success": true,
"data": {
"agent_id": "aid-8f3a1b2c4d5e6f70"
}
}agent_config 仅允许修改 beta 草稿版本;已发布版本仅能修改 agent_version_desc。要修改已发布版本的配置,需先调用 update 更新 beta 草稿,再调用 deploy 发布新版本。agent_config 结构与创建 Agent相同。DashScope API Key,在控制台 API Key 页面(https://bailian.console.aliyun.com/settings/apikey)获取。
Agent ID。
新的 Agent 名称,最长 200 字符。
新的 Agent 描述,最长 1000 字符。
Agent 版本号,默认 beta。传入已发布版本号时只能修改 agent_version_desc。
版本描述。
Agent 配置对象,不传则使用默认配置。
Show child attributes
Agent 使用的模型名称,如 qwen-plus-latest、qwen-max-latest。
Agent 策略,如 agentic。
是否开启防泄漏功能,true 或 false。
是否开启引用标注,true 或 false。
是否启用知识库路由(search 场景),true 或 false。
是否开启拒答功能,true 或 false。
是否开启富文本输出,true 或 false。
是否开启会话文件功能,true 或 false。
路由模型名称,enable_kb_router 为 true 时必填,须在平台白名单内。
知识库检索配置列表。
Show child attributes
知识库可信度等级,如 high、medium、low。
稠密检索返回的 Top-K 数量。
关联的知识库 Pipeline ID。
重排序最低分数阈值,分数低于此值的切片会被过滤。
重排序后保留的 Top-N 数量。
检索过滤条件,按知识库 schema 校验。
稀疏检索 Top K,范围 [1, 100]。
知识库权重。
最大生成 token 数,须大于等于 1。
Agent 最大 LLM 调用次数。
混排 Top N(search 场景),范围 [1, 20]。
会话文件最大解析长度,须小于模型的 max_context_length。
模型采样温度,取值范围 [0, 2]。
curl -X POST "https://{workspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/indices/rag/agent/update" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "aid-8f3a1b2c4d5e6f70",
"agent_name": "客服知识问答助手 v2",
"agent_config": {
"agent_policy": "agentic",
"agent_model": "qwen-max-latest",
"enable_session_file": "false",
"enable_refusal": "true",
"enable_anti_leak": "true",
"enable_rich_text": "false",
"enable_citation": "true",
"temperature": 0.7,
"max_num_llm_calls": 10,
"kb_search_configs": [
{
"id": "pipeline-xxxxxx",
"weight": 1,
"dense_similarity_top_k": 15,
"rerank_top_n": 5,
"rerank": {
"model_name": "gte-rerank-hybrid",
"rerank_mode": "custom",
"rerank_instruct": "根据用户问题的技术领域对文档进行相关性排序"
}
}
]
}
}'{
"request_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"status_code": 200,
"code": "Success",
"message": "",
"status": "SUCCESS",
"success": true,
"data": {
"agent_id": "aid-8f3a1b2c4d5e6f70"
}
}