Confirm

Updated at:

Calls the Confirm operation to confirm or reject a tool call requested by OSS Agent. When the Agent needs to perform a medium-risk or higher operation, it pauses execution and waits for user confirmation.

Usage notes

  • This operation is required only when the Chat operation returns a tool call request.

  • The id and name in toolCalls must match the tool call information returned by the Chat operation.

Request syntax

POST /api/chat/confirm HTTP/1.1

Request parameters

Parameter

Type

Required

Description

sessionId

string

Yes

The conversation session ID.

confirmed

boolean

Yes

Whether to approve the tool execution. Set to true to approve, or false to reject.

reason

string

No

The reason for confirmation or rejection. We recommend that you provide a reason when rejecting, so the Agent can adjust its subsequent behavior accordingly.

toolCalls

array<object>

Yes

The list of tool calls. Contains the tool information requested by the Agent.

toolCalls[].id

string

Yes

The tool call ID, returned by the Chat operation.

Example: call_662cc029b3444d8d923a7ea6

toolCalls[].name

string

Yes

The tool name.

Example: ossutil_safe

Response parameters

This operation uses streaming responses in the same format as the Chat operation. After confirmation, the Agent continues the operation and returns the execution result through streaming responses.

Parameter

Type

Description

(Streaming response)

string

The Agent's response message. The format is the same as the Chat operation's response parameters, containing the id, object, created, and choices fields.

Examples

Sample request:

POST /api/chat/confirm HTTP/1.1
Content-Type: application/json

{
  "sessionId": "550e8400-e29b-41d4-a716-446655440000",
  "confirmed": true,
  "reason": null,
  "toolCalls": [
    {
      "id": "call_662cc029b3444d8d923a7ea6",
      "name": "ossutil_safe"
    }
  ]
}

Sample response:

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "object": "chat.completion.chunk",
  "created": 1785476706,
  "choices": [
    {
      "index": 0,
      "delta": {
        "role": "assistant",
        "content": "The bucket ACL has been successfully set to private."
      }
    }
  ]
}