respan-sdk
Overview
respan-sdk is the foundational package that defines the shared vocabulary for the entire Respan Python ecosystem. It provides Pydantic types for log/span data, constant definitions for OTLP attributes and log types, filter types, and utility functions.
Version: 2.5.0 | Python: >3.9, <4.0
You typically do not install respan-sdk directly. It is installed automatically as a dependency of respan-tracing and respan-ai.
Package structure
Public exports
Types
RespanLogParams
The primary type for structuring LLM call data. This is the “contract” between integrations and the Respan backend.
All fields are optional except in the context of validate_and_separate_params(), which enforces minimum requirements for the Respan API.
RespanFullLogParams
Extended version of RespanLogParams with backend-only fields. Used internally by the Respan backend — integrations should not use this directly.
Additional fields beyond RespanLogParams:
Message
Usage
Constants
Log type constants
Used by instrumentation plugins to set respan.entity.log_type on spans.
LogType / LogTypeChoices
OTLP constants
Wire-format keys for OTLP JSON serialization. Used by the exporter — not typically needed by integrations.
Tracing constants
Filter types
FilterParamDict
Dict-based filter specification for controlling span export. Used with the export_filter parameter on decorators.
Supported operators: "" (equals), "not", "gt", "gte", "lt", "lte", "contains", "icontains", "startswith", "endswith", "regex", "in", "not_in", "empty", "not_empty".
MetricFilterParam
Single field filter condition.
FilterBundle
Collection of filter conditions with AND logic.
Span attributes
RespanSpanAttributes
Enum of Respan-specific span attribute keys.
RESPAN_SPAN_ATTRIBUTES_MAP
Maps friendly parameter names to their full OTEL attribute keys.
Base types
RespanBaseModel
All Respan types inherit from RespanBaseModel, which extends Pydantic’s BaseModel with dict-compatible access methods.
This means Respan types work interchangeably with both Pydantic attribute access (params.model) and dict-style access (params["model"]).