GetAgentSessionModel
Queries the model and thinking level configurations currently used by the session.
Operation description
Use the
sessionIdreturned by CreateAgentSession to query the configurations. This operation does not send messages or replay session history.Read the current model from
JsonRpcResponse.result.modelId. To modify it, call SetAgentSessionModel.The thinking level is an optional advanced configuration. The supported levels and current values are subject to the actual response of this operation, which may vary across different agents, models, and sessions.
Try it now
Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ada:GetAgentSessionModel |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Jsonrpc |
string |
No |
The JSON-RPC version. Set the value to |
2.0 |
| Id |
string |
No |
The client request identifier, which is echoed in the response. It is used to associate this call and does not have idempotent semantics. |
request-001 |
| Params |
any |
Yes |
The defined business parameter structure. For core nested fields, see the supplementary description. |
{"sessionId":"0123456789abcdef0123456789abcdef"} |
The request method is GET or POST, and the business parameters are located in the query. The region is determined by the client configuration. The example shows only the business parameters. Action, Version, identity, and signature are handled by the POP client, and Params is serialized once as required by the client.
| Name | Type | Required | Description | Example |
Params.sessionId | string | Yes | The session ID returned by CreateAgentSession. | 0123456789abcdef0123456789abcdef |
Request example
{
"Jsonrpc": "2.0",
"Id": "request-001",
"Params": {
"sessionId": "0123456789abcdef0123456789abcdef"
}
}
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The ID of the request, which is used for troubleshooting. |
0A1B2C3D-4E5F-6789-ABCD-EF0123456789 |
| JsonRpcResponse |
any |
The defined JSON-RPC response structure. For core nested fields, see the supplementary description. |
{"jsonrpc":"2.0","id":"request-001","result":{"modelId":"text-model-example","thinkingLevel":"off","thinkingLevels":["off","low","medium","high"]}} |
The Models[].Id in the model catalog is used to submit a selection, while the modelId returned by the session indicates the actual effective configuration. The two may differ. The invoker should save the setting result and verify it against the modelId returned by subsequent GetAgentSessionModel invocations. Do not determine failure solely based on the inequality between the catalog ID and the session ID string, and do not concatenate or remove the provider suffix yourself.
The model configuration is located in JsonRpcResponse.result.
| Name | Type | Description | Example |
JsonRpcResponse.jsonrpc | string | The JSON-RPC version. The current value is 2.0. | 2.0 |
JsonRpcResponse.id | string | The Id in the echo request. | request-001 |
JsonRpcResponse.result | any | The current model configuration structure. | {"modelId":"text-model-example"} |
JsonRpcResponse.result.modelId | string | The identity of the model actually used by the current session. | text-model-example |
JsonRpcResponse.result.thinkingLevel | string | Optional advanced configuration: the actual effective thinking level. Subject to the actual return value. The client should tolerate the absence of this field. | off |
JsonRpcResponse.result.thinkingLevels | array<string> | Optional advanced configuration: the thinking level options provided for the current session. An empty array or the absence of this field does not indicate that all levels are supported. | ["off","low","medium","high"] |
The default level in the model catalog may differ from the current level of the session. After setting thinkingLevel=default, the query result may be the actual effective level after restoring the default configurations, rather than the string default.
Sample success responses
The model identifiers in the example are for illustration purposes only. Use the actual queried model identifiers when making calls.
{
"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"
]
}
}
}
Examples
Success response
JSON format
{
"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\"]}}"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 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. |
See Error CodesError Codes for a complete list.
Release notes
See Release NotesRelease Notes for a complete list.