Skip to main content

LogSpanModelStreamContent

Content type for streaming LLM inference spans.

Overview

LogSpanModelStreamContent captures streaming model calls where individual chunks are collected alongside an aggregated final output. It is wrapped in a LogSpanContent union via the actual_instance pattern.

Fields

str
required
Must be "ModelStream".
str
required
The provider name (e.g., "openai", "anthropic"). 1–512 characters.
str
required
The model identifier (e.g., "gpt-4o", "claude-sonnet-4-20250514"). 1–512 characters.
str
required
The input payload as a JSON string. Must be valid, parseable JSON (the result of json.dumps()).
str
required
The raw streamed output. Typically the concatenated chunk payloads collected during streaming.
str
required
The aggregated final output as a JSON string. Must be valid, parseable JSON.
LogSpanVariable | None
Variable associated with this span for evaluation tracking. See LogSpanVariable.
float | None
Cost of inference in USD. Overrides the automatic cost calculated by Adaline. Minimum: 0.

Construction Pattern

All span content is wrapped in LogSpanContent using the actual_instance parameter:

Example