GetAgentSessionModel - 查询会话模型
查询会话当前使用的模型及思考等级配置。
接口说明
使用 CreateAgentSession 返回的
sessionId查询配置。本接口不发送消息,也不回放会话历史。从
JsonRpcResponse.result.modelId读取当前模型。需要修改时,调用 SetAgentSessionModel。思考等级为可选高级配置。支持的等级及当前值以本接口实际返回为准,不同智能体、模型和会话可能不同。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ada:GetAgentSessionModel |
get |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| Jsonrpc |
string |
否 |
JSON-RPC 版本,填写 |
2.0 |
| Id |
string |
否 |
客户端请求标识,在响应中回显。用于关联本次调用,不具有幂等语义。 |
request-001 |
| Params |
any |
是 |
已定义的业务参数结构,核心嵌套字段见补充说明。 |
{"sessionId":"0123456789abcdef0123456789abcdef"} |
调用方式为 GET 或 POST,业务参数位于 query。地域由客户端配置确定。示例仅展示业务参数;Action、Version、身份和签名由 POP 客户端处理,Params 按客户端要求序列化一次。
| 名称 | 类型 | 必填 | 描述 | 示例值 |
Params.sessionId | string | 是 | CreateAgentSession 返回的会话 ID。 | 0123456789abcdef0123456789abcdef |
请求示例
{
"Jsonrpc": "2.0",
"Id": "request-001",
"Params": {
"sessionId": "0123456789abcdef0123456789abcdef"
}
}
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| RequestId |
string |
本次请求 ID,用于问题排查。 |
0A1B2C3D-4E5F-6789-ABCD-EF0123456789 |
| JsonRpcResponse |
any |
已定义的 JSON-RPC 响应结构,核心嵌套字段见补充说明。 |
{"jsonrpc":"2.0","id":"request-001","result":{"modelId":"text-model-example","thinkingLevel":"off","thinkingLevels":["off","low","medium","high"]}} |
模型目录的 Models[].Id 用于提交选择,会话返回的 modelId 表示实际生效配置,两者可能不同。调用方应保存设置结果,并与后续 GetAgentSessionModel 返回的 modelId 核对;不要仅凭目录 ID 与会话 ID 字符串不相等判定失败,也不要自行拼接或移除提供方后缀。
模型配置位于 JsonRpcResponse.result。
| 名称 | 类型 | 描述 | 示例值 |
JsonRpcResponse.jsonrpc | string | JSON-RPC 版本,当前为 2.0。 | 2.0 |
JsonRpcResponse.id | string | 回显请求中的 Id。 | request-001 |
JsonRpcResponse.result | any | 当前模型配置结构。 | {"modelId":"text-model-example"} |
JsonRpcResponse.result.modelId | string | 当前会话实际使用的模型标识。 | text-model-example |
JsonRpcResponse.result.thinkingLevel | string | 可选高级配置:当前实际生效的思考等级。以实际返回值为准,客户端应容忍字段缺省。 | off |
JsonRpcResponse.result.thinkingLevels | array<string> | 可选高级配置:当前会话提供的思考等级选项。空数组或字段缺省不表示支持全部等级。 | ["off","low","medium","high"] |
模型目录中的默认等级与会话当前等级可能不同。设置 thinkingLevel=default 后,查询结果可能为恢复默认配置后实际生效的等级,而非字符串 default。
正常返回示例
示例中的模型标识仅用于说明,调用时应使用实际查询到的模型标识。
{
"RequestId": "0A1B2C3D-4E5F-6789-ABCD-EF0123456789",
"JsonRpcResponse": {
"jsonrpc": "2.0",
"id": "request-001",
"result": {
"modelId": "text-model-example",
"thinkingLevel": "off",
"thinkingLevels": [
"off",
"low",
"medium",
"high"
]
}
}
}
示例
正常返回示例
JSON格式
{
"RequestId": "0A1B2C3D-4E5F-6789-ABCD-EF0123456789",
"JsonRpcResponse": "{\"jsonrpc\":\"2.0\",\"id\":\"request-001\",\"result\":{\"modelId\":\"text-model-example\",\"thinkingLevel\":\"off\",\"thinkingLevels\":[\"off\",\"low\",\"medium\",\"high\"]}}"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InvalidParameter | The specified parameter is invalid. | |
| 401 | Unauthenticated | Authentication required. | |
| 500 | InternalError | Internal server error. | |
| 403 | Forbidden | You are not authorized to perform this operation. | |
| 404 | AgentSession.SessionNotFound | The specified agent session does not exist. | |
| 503 | ServiceUnavailable | The service is not ready or temporarily unavailable. |