Skip to main content
These are trace-export records, not the platform read models. Construct them for low-level submission through the tracing client, or let contexts and framework integrations construct them. The wire representation uses snake_case, string enum values, and ISO-8601 timestamps. Serialization omits selected null/empty fields as defined by each record’s serializer. Trace and LLM-span input/output use {"messages": [{"role": "user", "content": "..."}]}; other span kinds can carry domain-specific values. Token usage records prompt/completion/total tokens and may include provider-specific numeric usage. Cost is a dictionary of monetary amounts; the SDK does not calculate missing provider prices. Construct SpanData, TraceData, and ScoreData with their init objects; toApiDict() performs wire serialization. The init interfaces shown below describe accepted objects but are not independently exported at the package root.

On this page

ScoreData, ScoreDataInit, ScoreDataType, SpanData, SpanDataInit, SpanKind, SpanStatusCode, TraceData, TraceDataInit, TraceStatus.

Example

ScoreData

Source declaration

Constructor

Fields and properties

Methods

ScoreDataInit

Supporting contract used by the API below; it is not a separate package export. Source declaration

Fields and properties

ScoreDataType

Source declaration

Values

SpanData

Source declaration

Constructor

Fields and properties

Methods

Serialize to a dict matching the backend POST /traces span schema.

SpanDataInit

Supporting contract used by the API below; it is not a separate package export. Source declaration

Fields and properties

SpanKind

Source declaration

Values

SpanStatusCode

Source declaration

Values

TraceData

Source declaration

Constructor

Fields and properties

Methods

Serialize to a dict matching the backend POST /traces schema.

TraceDataInit

Supporting contract used by the API below; it is not a separate package export. Source declaration

Fields and properties

TraceStatus

Source declaration

Values


Signatures and fields are generated from the SDK source. See the import index for available entry points.