v1

latestOpenAPI 3.1.0Elastic 2.02026-07-179371211.2 KB
Assistant

Execute Tool

Execute a tool on behalf of the assistant and continue the conversation with the result. Note that more permissions may be checked depending on the tool being executed.

post/api/assistant/tool/{name}

Path parameters

namestring required

Name of the tool to execute

Request body

ModelToolRequest required

Response

AI assistant response messages after tool execution

idstring

The unique identifier for the message. Not required.

rolestring

Indicates who authored the message. Either user or assistant.

stop_reasonstring

The reason the message was stopped.

stop_sequencestring

The sequence in which the message was stopped.

thoughtsstring

The plain text thoughts from the model's response

Example response

[
  {
    "id": "c3d44fb8-3bc2-46e2-a7d2-8a8983556d1a",
    "role": "user",
    "stop_reason": "user_request",
    "stop_sequence": "end_turn",
    "usage": {
      "credits": 1,
      "input_tokens": 5,
      "output_tokens": 10
    }
  }
]