Skip to main content

ToolResponseContent

Tool/function execution response returned to the LLM.
from adaline_api.models.tool_response_content import ToolResponseContent

Fields

modality
str
required
Must be "tool-response".
index
int
required
Zero-based index matching the tool call. Minimum: 0.
id
str
required
Identifier matching the tool call id.
name
str
required
Name of the function that was called.
data
str
required
JSON-encoded string of the function result.
api_response
ToolResponseContentApiResponse | None
Optional API response metadata with status_code. Aliased as apiResponse in JSON.

Example

import json
from adaline_api.models.tool_response_content import ToolResponseContent
from adaline_api.models.message_content import MessageContent

tool_response = ToolResponseContent(
    modality="tool-response",
    index=0,
    id="call_abc123",
    name="get_weather",
    data=json.dumps({"temperature": 72, "conditions": "sunny"})
)

content = MessageContent(actual_instance=tool_response)
JSON:
{
  "modality": "tool-response",
  "index": 0,
  "id": "call_abc123",
  "name": "get_weather",
  "data": "{\"temperature\":72,\"conditions\":\"sunny\"}"
}