SpanData

class opik.api_objects.span.SpanData(trace_id: str, id: str = <factory>, parent_span_id: str | None = None, name: str | None = None, type: ~typing.Literal['general', 'tool', 'llm'] = 'general', start_time: ~datetime.datetime | None = <factory>, end_time: ~datetime.datetime | None = None, metadata: ~typing.Dict[str, ~typing.Any] | None = None, input: ~typing.Dict[str, ~typing.Any] | None = None, output: ~typing.Dict[str, ~typing.Any] | None = None, tags: ~typing.List[str] | None = None, usage: ~opik.types.UsageDict | None = None, feedback_scores: ~typing.List[~opik.types.FeedbackScoreDict] | None = None, project_name: str | None = None)

Bases: object

The SpanData object is returned when calling opik.opik_context.get_current_span_data() from a tracked function.

trace_id: str
id: str
parent_span_id: str | None = None
name: str | None = None
type: Literal['general', 'tool', 'llm'] = 'general'
start_time: datetime | None
end_time: datetime | None = None
metadata: Dict[str, Any] | None = None
input: Dict[str, Any] | None = None
output: Dict[str, Any] | None = None
tags: List[str] | None = None
usage: UsageDict | None = None
feedback_scores: List[FeedbackScoreDict] | None = None
project_name: str | None = None
update(**new_data: Any) SpanData
init_end_time() SpanData