LogSpanModelStreamContent
Span content for streaming LLM inference calls. Unlike LogSpanModelContent, this type captures both the raw stream chunks and an aggregated final output, giving you full visibility into the streaming lifecycle.Import
Type Definition
Properties
type- Discriminator field, always'ModelStream'for this content typeprovider- 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- Raw stream chunks concatenated into a single string (does not need to be valid JSON)aggregateOutput- The final assembled response as a JSON string (JSON.stringify()of the complete response)variables- Variable attached for evaluation tracking (LogSpanVariable)cost- Inference cost in USD
All fields except
variables and cost are required. This differs from LogSpanModelContent where every field is optional.Example
Related
- LogSpanContent — union type that includes
LogSpanModelStreamContent - LogSpanModelContent — non-streaming variant for single LLM calls
- LogSpanVariable — variable type used in the
variablesfield - Span — class that accepts
LogSpanContentviaspan.update()