LogSpanModelContent
The most commonly used span content type, representing a single LLM inference call. All fields are optional, allowing you to log as much or as little detail as you have available.
Import
Type Definition
Properties
type - Discriminator field, always 'Model' for this content type
provider - Provider name (e.g. 'openai', 'anthropic', 'google')
model - Model identifier (e.g. 'gpt-4o', 'claude-sonnet-4-20250514')
input - The request payload as a JSON string (JSON.stringify() of the request object)
output - The response payload as a JSON string (JSON.stringify() of the response object)
variables - Variable attached for evaluation tracking (LogSpanVariable)
cost - Inference cost in USD
Both input and output must be valid, parseable JSON strings (the result of JSON.stringify()). Passing a plain string that isn’t valid JSON will cause the span to be rejected.
For the best experience, 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
Avoid cherry-picking or reshaping the request/response before stringifying. Pass the raw objects — Adaline’s automatic parsing depends on seeing the provider’s native schema.
Examples
OpenAI
Anthropic
With Explicit Cost
With Variables for Evaluation
Minimal (All Fields Optional)
- LogSpanContent — union type that includes
LogSpanModelContent
- LogSpanVariable — variable type used in the
variables field
- Span — class that accepts
LogSpanContent via span.update()