LogSpanContent
Types used for log span content, traces, and spans in the Python SDK.TraceStatus
Valid status values for traces.| Value | Description |
|---|---|
"success" | The trace completed successfully. |
"failure" | The trace failed. |
"aborted" | The trace was aborted. |
"cancelled" | The trace was cancelled. |
"pending" | The trace is still in progress. |
"unknown" | Status is unknown (default). |
SpanStatus
Valid status values for spans.| Value | Description |
|---|---|
"success" | The span completed successfully. |
"failure" | The span failed. |
"aborted" | The span was aborted. |
"cancelled" | The span was cancelled. |
"unknown" | Status is unknown (default). |
LogSpanContent
All span content is wrapped inLogSpanContent using the actual_instance parameter. This is the discriminated union wrapper used by the Python SDK.
actual_instance must be one of the 8 content types documented below.
Content Types
LogSpanModelContent
See the dedicated LogSpanModelContent page for full documentation. Standard LLM inference calls.Fields
Must be
"Model" when provided.The provider name (e.g.,
"openai", "anthropic"). 1–512 characters.The model identifier (e.g.,
"gpt-4o", "claude-sonnet-4-20250514"). 1–512 characters.The input payload as a JSON string. See
input and output constraints.The output payload as a JSON string. See
input and output constraints.Variables associated with this span.
The cost of the operation. Minimum: 0.
input and output constraints
Both input and output must be valid, parseable JSON strings (i.e. the result of json.dumps()). Passing a plain string that isn’t valid JSON will cause the span to be rejected.
For Model spans specifically, you get the most out of Adaline when you pass the exact request payload you send to your provider as input, and the full provider response object as output. When you do this with a supported provider (OpenAI, Anthropic, Google, etc.), Adaline automatically:
- Calculates cost from token counts and the model’s pricing
- Extracts token usage (prompt, completion, and total tokens)
- Surfaces model metadata such as stop reason, tool calls, and function invocations
- Powers continuous evaluations with structured input/output pairs
json.dumps() the same dict as input. For output, call json.dumps() on the full response (using .model_dump() for Pydantic-based SDKs).
You can also set input and output to use Adaline’s own content schema, although this is more advanced and requires maintaining custom transformations to convert provider payloads into the Adaline format.
Examples
- OpenAI
- Anthropic
LogSpanModelStreamContent
See the dedicated LogSpanModelStreamContent page for full documentation. Streaming LLM inference calls.Fields
Must be
"ModelStream".The provider name. 1–512 characters.
The model identifier. 1–512 characters.
The input payload as a JSON string.
Raw streamed output chunks.
The aggregated final output as a JSON string.
The cost of the operation. Minimum: 0.
Example
LogSpanEmbeddingsContent
See the dedicated LogSpanEmbeddingsContent page for full documentation. Embedding generation calls.Fields
Must be
"Embeddings".The input payload as a JSON string.
The output payload as a JSON string.
Example
LogSpanFunctionContent
See the dedicated LogSpanFunctionContent page for full documentation. Custom application logic and function calls.Fields
Must be
"Function".The input payload as a JSON string.
The output payload as a JSON string.
Example
LogSpanToolContent
See the dedicated LogSpanToolContent page for full documentation. Tool and API invocations.Fields
Must be
"Tool".The input payload as a JSON string.
The output payload as a JSON string.
Example
LogSpanGuardrailContent
See the dedicated LogSpanGuardrailContent page for full documentation. Safety and compliance checks.Fields
Must be
"Guardrail".The input payload as a JSON string.
The output payload as a JSON string.
Example
LogSpanRetrievalContent
See the dedicated LogSpanRetrievalContent page for full documentation. RAG and vector database queries.Fields
Must be
"Retrieval".The input payload as a JSON string.
The output payload as a JSON string.
Example
LogSpanOtherContent
See the dedicated LogSpanOtherContent page for full documentation. Catch-all for any other operation type.Fields
Must be
"Other".The input payload as a JSON string.
The output payload as a JSON string.
Example
Supporting Types
LogSpanVariable
See the dedicated LogSpanVariable page for full documentation. Variable attached to a Model or ModelStream span for evaluation tracking.LogSpanVariableValue
Content value for a span variable. A discriminated union onmodality — can be TextContent, ImageContent, PdfContent, ReasoningContent, ToolCallContent, or ToolResponseContent.
LogAttributesValue
See the dedicated LogAttributesValue page for full documentation. The allowed value types for trace/span attributes:str, int, float, or bool.
Dict[str, LogAttributesValue] for the attributes parameter on traces and spans.
TraceStatus
See the dedicated TraceStatus page for full documentation. Allowed status values for a trace:"success", "failure", "aborted", "cancelled", "pending", "unknown".
SpanStatus
See the dedicated SpanStatus page for full documentation. Allowed status values for a span:"success", "failure", "aborted", "cancelled", "unknown".
Span status does not include
"pending" — that value is only available for traces.