Skip to main content

Documentation Index

Fetch the complete documentation index at: https://www.adaline.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

LogSpanToolContent

Content type for tool and API invocation spans.

Overview

LogSpanToolContent captures external tool calls and API invocations. It is wrapped in a LogSpanContent union via the actual_instance pattern.
from adaline_api.models.log_span_tool_content import LogSpanToolContent

Fields

type
str
required
Must be "Tool".
input
str
required
The input payload as a JSON string. Must be valid, parseable JSON (the result of json.dumps()).
output
str
required
The output payload as a JSON string. Must be valid, parseable JSON (the result of json.dumps()).

Construction Pattern

All span content is wrapped in LogSpanContent using the actual_instance parameter:
from adaline_api.models.log_span_content import LogSpanContent
from adaline_api.models.log_span_tool_content import LogSpanToolContent

content = LogSpanContent(
    actual_instance=LogSpanToolContent(
        type="Tool",
        input=json.dumps({"function": "search", "args": {"query": "weather"}}),
        output=json.dumps({"results": ["sunny", "72F"]}),
    )
)

Example

import json
from adaline_api.models.log_span_content import LogSpanContent
from adaline_api.models.log_span_tool_content import LogSpanToolContent

tool_input = {"function": "get_weather", "args": {"city": "San Francisco"}}
tool_output = {"temperature": 68, "condition": "foggy", "unit": "fahrenheit"}

span.update({
    "status": "success",
    "content": LogSpanContent(
        actual_instance=LogSpanToolContent(
            type="Tool",
            input=json.dumps(tool_input),
            output=json.dumps(tool_output),
        )
    ),
})