Skip to content

createGenerationSpan

function createGenerationSpan(options?, parent?): Span<GenerationSpanData>

Create a new generation span. The span will not be started automatically, you should either use withGenerationSpan() or call span.start() and span.end() manually.

This span captures the details of a model generation, including input/output message sequences, model information, and usage data. If you only need to capture a model response identifier, consider using createResponseSpan() instead.

Parameter Type

options?

DeepPartial<CreateSpanOptions<GenerationSpanData>>

parent?

| Span<any> | Trace

Span<GenerationSpanData>