RespondAgentAction
Responds to pending confirmation actions (approvals) or clarification questions generated during an agent run to allow the agent to continue execution.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
odps:RespondAgentAction |
create |
*All Resource
|
None | None |
Request syntax
POST /api/v1/ai/chat/respond HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body. |
|
| conversationId |
string |
Yes |
The conversation ID. |
123456789012****#cn-shanghai#1ee04bea-0488-46b6-b85b-827e3cd37e55 |
| actionId |
string |
Yes |
The ID of the action to respond to. This value is obtained from the action_id field of the action event in the ChatSse event stream. |
exec:01J5ZKQ8M7N2P4R6T8V0W2X4Y6 |
| decision |
string |
Yes |
The approval decision. This parameter is required for approval actions. Valid values: allow-once (allows the action this time) and deny (rejects the action). The value allow-always is not accepted. This field is ignored for question actions. Use optionIds and freeText to answer questions instead. |
allow-once |
| actionKind |
string |
No |
The action type. Valid values: exec (command execution approval), plugin (plugin operation approval), and question (clarification question). If this parameter is not specified, the type is inferred from the prefix of the actionId. |
exec |
| responseText |
string |
No |
A reserved field. The server does not consume this field. |
Supplementary description |
| agentType |
string |
No |
The agent type. Valid values: MaxAgent (default, MaxCompute intelligent assistant) and DataAgent (data analytics agent). |
DataAgent |
| optionIds |
array |
No |
The list of option IDs for question actions. A maximum of six options are allowed. For single-choice questions, a maximum of one option is allowed. You can specify zero options, but you must provide a non-empty freeText value in this case. |
|
|
string |
No |
The option ID, which is obtained from the option list provided in the clarification question event. |
opt-1 |
|
| freeText |
string |
No |
The free-text answer for question actions. The maximum length is 2,048 characters. This parameter is accepted only when the question allows free-text answers. |
Analyze the data for the last 30 days |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
PopResult |
||
| requestId |
string |
The request ID, which uniquely identifies the request and can be used for troubleshooting and log correlation. |
A3F5B7C9-1D2E-4F6A-8B9C-0D1E2F3A4B5C |
| httpCode |
integer |
The business status code. This field is not returned if the call is successful. If the call fails, the corresponding HTTP error code is returned, such as 400, 403, 404, or 500. |
400 |
| errorCode |
string |
The error code. This field is not returned if the call is successful. If the call fails, a specific error code is returned to help locate the cause of the error. |
InvalidParameter |
| errorMsg |
string |
The error message. This field is not returned if the call is successful. If the call fails, a human-readable error description is returned. |
The specified parameter is invalid. |
| data |
object |
The response result. |
|
| success |
boolean |
Indicates whether the action was successfully responded to. |
|
| conversationId |
string |
The conversation ID. |
123456789012****#cn-shanghai#1ee04bea-0488-46b6-b85b-827e3cd37e55 |
| actionId |
string |
The ID of the responded action. |
exec:01J5ZKQ8M7N2P4R6T8V0W2X4Y6 |
| approvalKind |
string |
The action category. Valid values: exec, plugin, and question. |
exec |
| decision |
string |
The effective decision. For approval actions, the value is allow-once or deny. For question actions, the value is resolved. |
allow-once |
| runId |
string |
The agent run ID to which the action belongs. If no run is associated, an empty string is returned. |
9f8e7d6c5b4a39281706f5e4d3c2b1a0 |
| response |
object |
The detailed result of the action processing. If the response fails, this field contains the failure reason. Examples include empty_answer (no answer is provided for a question action) and unsupported_decision (the approval decision is not accepted, and allowedDecisions is returned to list the valid values). |
|
| status |
string |
The action processing status, such as resolved. |
resolved |
| reason |
string |
The failure reason. For example, empty_answer indicates that no option or text answer was provided for a question action, and unsupported_decision indicates that the approval decision is not within the accepted range. |
empty_answer |
| id |
string |
The action ID. |
exec:01J5ZKQ8M7N2P4R6T8V0W2X4Y6 |
Examples
Success response
JSON format
{
"requestId": "A3F5B7C9-1D2E-4F6A-8B9C-0D1E2F3A4B5C",
"httpCode": 400,
"errorCode": "InvalidParameter",
"errorMsg": "The specified parameter is invalid.",
"data": {
"success": false,
"conversationId": "123456789012****#cn-shanghai#1ee04bea-0488-46b6-b85b-827e3cd37e55",
"actionId": "exec:01J5ZKQ8M7N2P4R6T8V0W2X4Y6",
"approvalKind": "exec",
"decision": "allow-once",
"runId": "9f8e7d6c5b4a39281706f5e4d3c2b1a0",
"response": {
"status": "resolved",
"reason": "empty_answer",
"id": "exec:01J5ZKQ8M7N2P4R6T8V0W2X4Y6"
}
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.