查询智能体任务模板详情¶
查询一个智能体任务模板的完整配置。
GET https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/agent-task-templates/{template_id}
调用前准备¶
准备个人访问令牌、工作区 ID 和模板 ID。
请求参数¶
curl "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/agent-task-templates/$TEMPLATE_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
路径参数
参数 |
类型 |
是否必填 |
说明 |
|---|---|---|---|
|
string |
是 |
目标工作区 ID。 |
|
string |
是 |
要查询的模板 ID。 |
成功响应¶
{
"code": 0,
"data": {
"id": "template_01",
"workspace_id": "workspace_example",
"agent_id": "agent_01",
"name": "摘要任务",
"message_template": {
"role": "user",
"template": "请总结输入内容"
},
"idempotency_policy": {
"mode": "workflow_case"
},
"status": "draft",
"version": 1,
"created_at": "2026-10-14T00:00:00Z",
"updated_at": "2026-10-14T00:00:00Z"
}
}
字段 |
类型 |
说明 |
|---|---|---|
|
integer |
请求处理成功时为 |
|
object |
响应数据。 |
|
string |
对象 ID。 |
|
string |
所属工作区 ID。 |
|
string |
关联的智能体 ID。 |
|
string |
名称。 |
|
string |
说明。未设置时可省略。 |
|
object |
消息模板。 |
|
object |
输入参数的 JSON Schema。未设置时可省略。 |
|
object(对象数组) |
默认上下文资源引用。未设置时可省略。 |
|
string |
对象 ID。 |
|
string |
运行策略引用。未设置时可省略。 |
|
object |
幂等策略。 |
|
string |
策略或范围模式。取值: |
|
string |
自定义幂等键模板。未设置时可省略。 |
|
integer |
幂等窗口,单位为秒。未设置时可省略。 |
|
object |
输出约定。未设置时可省略。 |
|
string |
当前状态。取值: |
|
integer |
当前版本号。 |
|
object |
标签键值对。未设置时可省略。 |
|
object |
扩展注解。未设置时可省略。 |
|
string |
创建者标识。未设置时可省略。 |
|
string |
最近更新者标识。未设置时可省略。 |
|
string |
创建时间,采用 RFC 3339 格式。 |
|
string |
最近更新时间,采用 RFC 3339 格式。 |
|
string |
消息角色。 |
|
string |
消息模板文本。使用 parts 时可省略。 |
|
array 或 null |
结构化消息组成项,内容由模板保留。 |
|
object 或 null |
模板变量。 |
|
string |
上下文资源类型。 |
|
string |
资源地址。使用 id 时可省略。 |
|
string |
资源版本。未设置时省略。 |
|
object 或 null |
资源配置。未设置时省略。 |
错误响应¶
{
"code": 3,
"message": "agent task template not found"
}
常见 HTTP 错误
HTTP 状态码 |
错误代码 |
说明 |
|---|---|---|
|
|
**常见原因:**模板不存在或当前身份不可读取。**建议操作:**核对模板 ID 和工作区。 |