# 获取三方托管智能体配置 - ShowOpsThirdPartyAgent
#### 功能介绍
该接口用于获取三方托管智能体的配置信息，包含调用参数和调试状态。配置信息在调试接口调用成功后自动保存至数据库。
适用场景：
- 查看配置：查看三方智能体已保存的调用配置信息。
  
- 确认调试状态：确认三方智能体是否已调试通过，评估任务创建时需引用已调试通过的配置。
  
 
#### 调用方法
请参见[如何调用API](https://support.huaweicloud.com/api-agentarts/agentarts_07_0003.html)。
#### 授权信息
账号根用户具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备如下身份策略权限，更多的权限说明请参见[权限和授权项](https://support.huaweicloud.com/api-agentarts/Permission.html)。
| 授权项                               | 访问级别 | 资源类型（\*为必须） | 条件键 | 别名 | 依赖的授权项 |
|:---|:---|:---|:---|:---|:---|
| agentarts::showOpsThirdPartyAgent | Read | -           | -   | -  | -      |
   
#### URI
GET /v1/ops/third-party-agents/{agent_id}
表1路径参数 
| 参数       | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
|:---|:---|:---|:---|
| agent_id | 是    | String | **参数解释：** 合成任务的唯一标识符（ID），该参数用于在路径中指定特定的合成任务，以便执行查询、停止或删除等操作。获取方式：可通过创建合成任务接口返回的id获取，或通过查询合成任务列表接口获取。 **约束限制：** 不涉及。 **取值范围：** 1\~36个字符，通常采用标准UUID格式。 **默认取值：** 不涉及。 |
   
表2Query参数 
| 参数   | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|:---|:---|:---|:---|
| type | 是    | String | **参数解释：** 调试对象类型，用于区分三方托管智能体和智能体运行时。 **约束限制：** 必须为枚举值之一，必填。 **取值范围：** - third_party_agent：三方托管智能体   - agent_runtime：智能体运行时    **默认取值：** 不涉及。 |
   
#### 请求参数
无
#### 响应参数
**状态码：200**
表3响应Body参数 
| 参数                    | 参数类型                                                                                                          | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
|:---|:---|:---|
| agent_id              | String                                                                                                        | **参数解释：** 三方智能体ID（来自可观测服务）。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| agent_name            | String                                                                                                        | **参数解释：** 三方智能体名称（来自可观测服务）。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| description           | String                                                                                                        | **参数解释：** 三方智能体配置描述，用于说明配置用途。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| type                  | String                                                                                                        | **参数解释：** 调试对象类型，区分三方托管智能体和智能体运行时。 **取值范围：** - third_party_agent：三方托管智能体   - agent_runtime：智能体运行时                                                                                                                                                                          |
| agent_type            | String                                                                                                        | **参数解释：** 智能体类型。 **取值范围：** - workflow：工作流   - agent：智能体   - multiagents：多智能体     |
| api_config            | [OpsThirdPartyAgentApiConfig] object           | **参数解释：** 三方托管智能体的API访问配置。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| auth_config           | [auth_config] object                                           | **参数解释：** 鉴权配置，API Key脱敏返回（仅显示前4位和后4位，中间用\*号替代）。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| response_config       | [OpsThirdPartyAgentResponseConfig] object | **参数解释：** 三方托管智能体的响应配置。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| timeout               | Integer                                                                                                       | **参数解释：** 单次调用超时时间（秒）。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| debug_status          | String                                                                                                        | **参数解释：** 调试状态。 **取值范围：** - NOT_DEBUGGED：未配置   - SUCCESS：调试成功   - FAILED：调试失败    |
| last_debug_time       | String                                                                                                        | **参数解释：** 最近一次调试时间。时间格式为yyyy-MM-ddTHH:mm:ssZ，示例：2024-01-01T12:00:00Z。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| last_debug_error      | String                                                                                                        | **参数解释：** 最近一次调试失败原因，仅debug_status为FAILED时有值。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| create_time           | String                                                                                                        | **参数解释：** 配置创建时间。时间格式为yyyy-MM-ddTHH:mm:ssZ，示例：2024-01-01T12:00:00Z。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| source                | String                                                                                                        | **参数解释：** 智能体来源。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| name                  | String                                                                                                        | **参数解释：** 智能体名称（可观测服务返回）。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| total_token           | Long                                                                                                          | **参数解释：** 累计Token消耗。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| avg_request_count     | Double                                                                                                        | **参数解释：** 平均请求次数。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| avg_duration_time     | Double                                                                                                        | **参数解释：** 平均响应耗时。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| avg_fail_count        | Double                                                                                                        | **参数解释：** 平均失败次数。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| apm_app_id            | String                                                                                                        | **参数解释：** APM 应用ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| aom_prom_id           | String                                                                                                        | **参数解释：** AOM Prometheus ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| lts_group_id          | String                                                                                                        | **参数解释：** LTS 日志组ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| lts_stream_id         | String                                                                                                        | **参数解释：** LTS 日志流ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| lts_label_name        | String                                                                                                        | **参数解释：** LTS 标签名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| apm_exporter_endpoint | String                                                                                                        | **参数解释：** APM Exporter 端点。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| aom_exporter_endpoint | String                                                                                                        | **参数解释：** AOM Exporter 端点。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| lts_exporter_endpoint | String                                                                                                        | **参数解释：** LTS Exporter 端点。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
   
 表4OpsThirdPartyAgentApiConfig 
| 参数           | 参数类型                                                                                                                | 描述                                                                                                                                                                                                              |
|:---|:---|:---|
| url          | String                                                                                                              | **参数解释：** 三方智能体的API访问地址。 **取值范围：** 由英文字母、数字、特殊字符(:/.-?\&=%_)组成的字符串，长度为1\~2048个字符。 |
| headers      | Array of [OpsThirdPartyAgentKeyValuePair] objects | **参数解释：** 请求Header参数列表。 **取值范围：** 不涉及。                                            |
| query_params | Array of [OpsThirdPartyAgentKeyValuePair] objects | **参数解释：** 请求Query参数列表。 **取值范围：** 不涉及。                                             |
| body         | [OpsThirdPartyAgentRequestBodyConfig] object | **参数解释：** 三方智能体请求Body配置。 **取值范围：** 不涉及。                                           |
   
 表5OpsThirdPartyAgentKeyValuePair 
| 参数          | 参数类型   | 描述                                                                                                                                                                         |
|:---|:---|:---|
| key         | String | **参数解释：** 参数名。 **取值范围：** 不涉及。                |
| value       | String | **参数解释：** 参数值，支持使用{{变量名}}占位符。 **取值范围：** 不涉及。 |
| description | String | **参数解释：** 参数描述，用于说明该参数的用途。 **取值范围：** 不涉及。    |
   
 表6OpsThirdPartyAgentRequestBodyConfig 
| 参数      | 参数类型   | 描述                                                                                                                                                                                           |
|:---|:---|:---|
| content | String | **参数解释：** 请求Body模板内容，支持使用{{变量名}}占位符，运行时会替换为实际值。 **取值范围：** 不涉及。 |
   
 表7auth_config 
| 参数               | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|:---|:---|:---|
| type             | String | **参数解释：** 鉴权类型。 **取值范围：** - API_KEY：API Key鉴权   - NONE：无需鉴权                                              |
| api_key          | String | **参数解释：** API Key值，当type为API_KEY时必填。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| api_key_position | String | **参数解释：** API Key传递位置，当type为API_KEY时必填。 **取值范围：** - HEADER：放在HTTP请求Header中   - QUERY：放在HTTP请求Query参数中    |
| api_key_name     | String | **参数解释：** API Key参数名，当type为API_KEY时必填。 **取值范围：** 由英文字母、数字、点(.)、连字符(-)及下划线(_)组成的字符串，长度为1\~100个字符。                                                                                                                                                                                                                                                                                                                                                                                             |
   
 表8OpsThirdPartyAgentResponseConfig 
| 参数                | 参数类型                                                                                                            | 描述                                                                                                                                                                                                                              |
|:---|:---|:---|
| type              | String                                                                                                          | **参数解释：** 响应类型。 **取值范围：** STREAM（流式输出）、NON_STREAM（非流式输出）。                                         |
| stream_config     | [OpsThirdPartyAgentStreamConfig] object       | **参数解释：** 流式响应配置，用于解析SSE流式输出。SSE的data字段为JSON字符串，需要通过匹配条件筛选目标数据，再从目标数据中提取Agent输出内容。 **取值范围：** 不涉及。 |
| non_stream_config | [OpsThirdPartyAgentNonStreamConfig] object | **参数解释：** 非流式响应配置，用于从响应体中提取Agent输出。 **取值范围：** 不涉及。                                                |
   
 表9OpsThirdPartyAgentStreamConfig 
| 参数              | 参数类型                                                                                                                  | 描述                                                                                                                                                                                                                                                   |
|:---|:---|:---|
| event_type      | String                                                                                                                | **参数解释：** 需要匹配的SSE事件类型，用于识别Agent输出事件。不填则匹配所有事件类型。 **取值范围：** 不涉及。                                                       |
| match_condition | [OpsThirdPartyAgentDataMatchCondition] object | **参数解释：** 数据匹配条件，当data JSON中指定字段的值等于期望值时，视为目标数据，从该数据中提取Agent输出。                                                                                                                                            |
| output_key      | String                                                                                                                | **参数解释：** 目标数据中Agent输出内容的字段路径，支持多级路径（如aa.bb.cc）。仅当match_condition匹配成功时，从该条数据中提取output_key对应的值作为Agent输出。 **取值范围：** 不涉及。 |
| end_condition   | [OpsThirdPartyAgentDataMatchCondition] object | **参数解释：** 流结束匹配条件，当data JSON中指定字段的值等于期望值时，标识流式输出结束。                                                                                                                                                        |
| end_event_type  | String                                                                                                                | **参数解释：** 标识流式输出结束的SSE事件类型。不填则仅通过end_condition判断流结束。 **取值范围：** 不涉及。                                                    |
   
 表10OpsThirdPartyAgentDataMatchCondition 
| 参数    | 参数类型   | 描述                                                                                                                                                                                                 |
|:---|:---|:---|
| key   | String | **参数解释：** data JSON字符串中用于匹配筛选的字段路径，支持多级路径（如aa.bb.cc）。 **取值范围：** 不涉及。 |
| value | String | **参数解释：** key对应字段的期望值，当data中该字段值等于value时，视为匹配成功。 **取值范围：** 不涉及。      |
   
 表11OpsThirdPartyAgentNonStreamConfig 
| 参数         | 参数类型   | 描述                                                                                                                                                                                                                    |
|:---|:---|:---|
| output_key | String | **参数解释：** 响应体中Agent输出内容的字段路径，支持多级路径（如data.choices\[0\].message.content）。 **取值范围：** 不涉及。 |
   
**状态码：400**
表12响应Body参数 
| 参数                            | 参数类型                                                                                | 描述                                                                                                                                                                                             |
|:---|:---|:---|
| error_code                    | String                                                                              | **参数解释：** 系统定义的标准化错误代码。 **取值范围：** 业务异常编码字符串。                     |
| error_msg                     | String                                                                              | **参数解释：** 对错误的详细描述，包含异常原因或解决建议。 **取值范围：** 字符长度2-512，任意文本内容。      |
| encoded_authorization_message | String                                                                              | **参数解释：** 编码后的授权信息，用于客户端解析权限问题。 **取值范围：** Base64编码的字符串。          |
| details                       | Array of [OpsErrorDetail] objects | **参数解释：** 错误详情列表，包含多个子错误的详细信息。 **取值范围：** 不涉及。                    |
| request_id                    | String                                                                              | **参数解释：** 请求的唯一标识符，用于问题排查和链路追踪。 **取值范围：** 符合通用唯一识别码(UUID)标准的字符串。 |
   
 表13OpsErrorDetail 
| 参数         | 参数类型   | 描述                                                                                                                                                                        |
|:---|:---|:---|
| error_code | String | **参数解释：** 子错误的标准化错误代码。 **取值范围：** 业务异常编码字符串。 |
| error_msg  | String | **参数解释：** 对子错误的详细描述。 **取值范围：** 任意文本内容。      |
   
**状态码：401**
表14响应Body参数 
| 参数                            | 参数类型                                                                                  | 描述                                                                                                                                                                                             |
|:---|:---|:---|
| error_code                    | String                                                                                | **参数解释：** 系统定义的标准化错误代码。 **取值范围：** 业务异常编码字符串。                     |
| error_msg                     | String                                                                                | **参数解释：** 对错误的详细描述，包含异常原因或解决建议。 **取值范围：** 字符长度2-512，任意文本内容。      |
| encoded_authorization_message | String                                                                                | **参数解释：** 编码后的授权信息，用于客户端解析权限问题。 **取值范围：** Base64编码的字符串。          |
| details                       | Array of [OpsErrorDetail] objects | **参数解释：** 错误详情列表，包含多个子错误的详细信息。 **取值范围：** 不涉及。                    |
| request_id                    | String                                                                                | **参数解释：** 请求的唯一标识符，用于问题排查和链路追踪。 **取值范围：** 符合通用唯一识别码(UUID)标准的字符串。 |
   
 表15OpsErrorDetail 
| 参数         | 参数类型   | 描述                                                                                                                                                                        |
|:---|:---|:---|
| error_code | String | **参数解释：** 子错误的标准化错误代码。 **取值范围：** 业务异常编码字符串。 |
| error_msg  | String | **参数解释：** 对子错误的详细描述。 **取值范围：** 任意文本内容。      |
   
**状态码：403**
表16响应Body参数 
| 参数                            | 参数类型                                                                                  | 描述                                                                                                                                                                                             |
|:---|:---|:---|
| error_code                    | String                                                                                | **参数解释：** 系统定义的标准化错误代码。 **取值范围：** 业务异常编码字符串。                     |
| error_msg                     | String                                                                                | **参数解释：** 对错误的详细描述，包含异常原因或解决建议。 **取值范围：** 字符长度2-512，任意文本内容。      |
| encoded_authorization_message | String                                                                                | **参数解释：** 编码后的授权信息，用于客户端解析权限问题。 **取值范围：** Base64编码的字符串。          |
| details                       | Array of [OpsErrorDetail] objects | **参数解释：** 错误详情列表，包含多个子错误的详细信息。 **取值范围：** 不涉及。                    |
| request_id                    | String                                                                                | **参数解释：** 请求的唯一标识符，用于问题排查和链路追踪。 **取值范围：** 符合通用唯一识别码(UUID)标准的字符串。 |
   
 表17OpsErrorDetail 
| 参数         | 参数类型   | 描述                                                                                                                                                                        |
|:---|:---|:---|
| error_code | String | **参数解释：** 子错误的标准化错误代码。 **取值范围：** 业务异常编码字符串。 |
| error_msg  | String | **参数解释：** 对子错误的详细描述。 **取值范围：** 任意文本内容。      |
   
**状态码：404**
表18响应Body参数 
| 参数                            | 参数类型                                                                                  | 描述                                                                                                                                                                                             |
|:---|:---|:---|
| error_code                    | String                                                                                | **参数解释：** 系统定义的标准化错误代码。 **取值范围：** 业务异常编码字符串。                     |
| error_msg                     | String                                                                                | **参数解释：** 对错误的详细描述，包含异常原因或解决建议。 **取值范围：** 字符长度2-512，任意文本内容。      |
| encoded_authorization_message | String                                                                                | **参数解释：** 编码后的授权信息，用于客户端解析权限问题。 **取值范围：** Base64编码的字符串。          |
| details                       | Array of [OpsErrorDetail] objects | **参数解释：** 错误详情列表，包含多个子错误的详细信息。 **取值范围：** 不涉及。                    |
| request_id                    | String                                                                                | **参数解释：** 请求的唯一标识符，用于问题排查和链路追踪。 **取值范围：** 符合通用唯一识别码(UUID)标准的字符串。 |
   
 表19OpsErrorDetail 
| 参数         | 参数类型   | 描述                                                                                                                                                                        |
|:---|:---|:---|
| error_code | String | **参数解释：** 子错误的标准化错误代码。 **取值范围：** 业务异常编码字符串。 |
| error_msg  | String | **参数解释：** 对子错误的详细描述。 **取值范围：** 任意文本内容。      |
   
**状态码：429**
表20响应Body参数 
| 参数                            | 参数类型                                                                                  | 描述                                                                                                                                                                                             |
|:---|:---|:---|
| error_code                    | String                                                                                | **参数解释：** 系统定义的标准化错误代码。 **取值范围：** 业务异常编码字符串。                     |
| error_msg                     | String                                                                                | **参数解释：** 对错误的详细描述，包含异常原因或解决建议。 **取值范围：** 字符长度2-512，任意文本内容。      |
| encoded_authorization_message | String                                                                                | **参数解释：** 编码后的授权信息，用于客户端解析权限问题。 **取值范围：** Base64编码的字符串。          |
| details                       | Array of [OpsErrorDetail] objects | **参数解释：** 错误详情列表，包含多个子错误的详细信息。 **取值范围：** 不涉及。                    |
| request_id                    | String                                                                                | **参数解释：** 请求的唯一标识符，用于问题排查和链路追踪。 **取值范围：** 符合通用唯一识别码(UUID)标准的字符串。 |
   
 表21OpsErrorDetail 
| 参数         | 参数类型   | 描述                                                                                                                                                                        |
|:---|:---|:---|
| error_code | String | **参数解释：** 子错误的标准化错误代码。 **取值范围：** 业务异常编码字符串。 |
| error_msg  | String | **参数解释：** 对子错误的详细描述。 **取值范围：** 任意文本内容。      |
   
**状态码：500**
表22响应Body参数 
| 参数                            | 参数类型                                                                                  | 描述                                                                                                                                                                                             |
|:---|:---|:---|
| error_code                    | String                                                                                | **参数解释：** 系统定义的标准化错误代码。 **取值范围：** 业务异常编码字符串。                     |
| error_msg                     | String                                                                                | **参数解释：** 对错误的详细描述，包含异常原因或解决建议。 **取值范围：** 字符长度2-512，任意文本内容。      |
| encoded_authorization_message | String                                                                                | **参数解释：** 编码后的授权信息，用于客户端解析权限问题。 **取值范围：** Base64编码的字符串。          |
| details                       | Array of [OpsErrorDetail] objects | **参数解释：** 错误详情列表，包含多个子错误的详细信息。 **取值范围：** 不涉及。                    |
| request_id                    | String                                                                                | **参数解释：** 请求的唯一标识符，用于问题排查和链路追踪。 **取值范围：** 符合通用唯一识别码(UUID)标准的字符串。 |
   
 表23OpsErrorDetail 
| 参数         | 参数类型   | 描述                                                                                                                                                                        |
|:---|:---|:---|
| error_code | String | **参数解释：** 子错误的标准化错误代码。 **取值范围：** 业务异常编码字符串。 |
| error_msg  | String | **参数解释：** 对子错误的详细描述。 **取值范围：** 任意文本内容。      |
   
#### 请求示例
获取三方智能体的配置信息和调试状态。
```
GET https://api.example.com/v1/ops/third-party-agents/550e8400-e29b-41d4-a716-446655440000
```
#### 响应示例
**状态码：200**
无
**状态码：400**
```
{
  "error_code" : "AgentArts.10004001",
  "error_msg" : "file_suffix is required"
}
```
**状态码：401**
```
{
  "error_code" : "AgentArts.100004010",
  "error_msg" : "unauthorized"
}
```
**状态码：403**
```
{
  "error_code" : "AgentArts.100004030",
  "error_msg" : "forbidden"
}
```
**状态码：404**
```
{
  "error_code" : "AgentArts.10004001",
  "error_msg" : "三方智能体配置不存在"
}
```
**状态码：429**
```
{
  "error_code" : "AgentArts.100004290",
  "error_msg" : "请求过于频繁"
}
```
**状态码：500**
```
{
  "error_code" : "AgentArts.03500001",
  "error_msg" : "internal error"
}
```
#### 状态码
| 状态码 | 描述         |
|:---|:---|
| 200 | 获取成功       |
| 400 | 请求参数错误     |
| 401 | 认证失败       |
| 403 | 鉴权失败       |
| 404 | 三方智能体配置不存在 |
| 429 | 请求过于频繁     |
| 500 | 系统错误       |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-agentarts/ErrorCode.html)。
