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. Export records are Pydantic models. Required fields and defaults are shown below; to_api_dict() performs wire serialization. Standard Pydantic construction and serialization methods remain available. Validation helpers report malformed message structure; they do not validate business correctness.

On this page

ScoreData, ScoreDataType, SpanData, SpanKind, SpanStatusCode, TraceData, TraceStatus, extract_last_assistant_message, extract_last_user_message, validate_messages_format, warn_if_invalid_messages.

Example

ScoreData

Source declaration Construct with keyword fields below. Pydantic validates the model and provides its standard serialization methods.

Fields and properties

Methods

ScoreDataType

Also exported from pandaprobe.schemas. Source declaration

Values

SpanData

Source declaration Construct with keyword fields below. Pydantic validates the model and provides its standard serialization methods.

Fields and properties

Methods

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

SpanKind

Also exported from pandaprobe.schemas. Source declaration

Values

SpanStatusCode

Also exported from pandaprobe.schemas. Source declaration

Values

TraceData

Source declaration Construct with keyword fields below. Pydantic validates the model and provides its standard serialization methods.

Fields and properties

Methods

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

TraceStatus

Also exported from pandaprobe.schemas. Source declaration

Values

extract_last_assistant_message

Extract only the last assistant message from a messages structure. Source declaration

extract_last_user_message

Extract only the last user message from a messages structure. Source declaration

validate_messages_format

Validate that data follows the standard messages schema. Source declaration

warn_if_invalid_messages

Log a warning if data doesn’t follow the messages schema. Source declaration

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