SpanPublic¶
- class opik.rest_api.types.span_public.SpanPublic(*, id: str | None = None, project_id: str | None = None, trace_id: str, parent_span_id: str | None = None, name: str, type: Literal['general', 'tool', 'llm'] | Any, start_time: datetime, end_time: datetime | None = None, input: Dict[str, Any | None] | None = None, output: Dict[str, Any | None] | None = None, metadata: Dict[str, Any | None] | None = None, model: str | None = None, provider: str | None = None, tags: List[str] | None = None, usage: Dict[str, int] | None = None, created_at: datetime | None = None, last_updated_at: datetime | None = None, created_by: str | None = None, last_updated_by: str | None = None, feedback_scores: List[FeedbackScorePublic] | None = None, total_estimated_cost: float | None = None, **extra_data: Any)¶
Bases:
UniversalBaseModel
- id: str | None¶
- project_id: str | None¶
- trace_id: str¶
- parent_span_id: str | None¶
- name: str¶
- type: Literal['general', 'tool', 'llm'] | Any¶
- start_time: datetime¶
- end_time: datetime | None¶
- input: Dict[str, Any | None] | None¶
- output: Dict[str, Any | None] | None¶
- metadata: Dict[str, Any | None] | None¶
- model: str | None¶
- provider: str | None¶
- tags: List[str] | None¶
- usage: Dict[str, int] | None¶
- created_at: datetime | None¶
- last_updated_at: datetime | None¶
- created_by: str | None¶
- last_updated_by: str | None¶
- feedback_scores: List[FeedbackScorePublic] | None¶
- total_estimated_cost: float | None¶
- model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'frozen': True, 'protected_namespaces': ()}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'created_at': FieldInfo(annotation=Union[datetime, NoneType], required=False, default=None), 'created_by': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'end_time': FieldInfo(annotation=Union[datetime, NoneType], required=False, default=None), 'feedback_scores': FieldInfo(annotation=Union[List[FeedbackScorePublic], NoneType], required=False, default=None), 'id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'input': FieldInfo(annotation=Union[Dict[str, Union[Any, NoneType]], NoneType], required=False, default=None), 'last_updated_at': FieldInfo(annotation=Union[datetime, NoneType], required=False, default=None), 'last_updated_by': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'metadata': FieldInfo(annotation=Union[Dict[str, Union[Any, NoneType]], NoneType], required=False, default=None), 'model': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'name': FieldInfo(annotation=str, required=True), 'output': FieldInfo(annotation=Union[Dict[str, Union[Any, NoneType]], NoneType], required=False, default=None), 'parent_span_id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'project_id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'provider': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'start_time': FieldInfo(annotation=datetime, required=True), 'tags': FieldInfo(annotation=Union[List[str], NoneType], required=False, default=None), 'total_estimated_cost': FieldInfo(annotation=Union[float, NoneType], required=False, default=None), 'trace_id': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=Union[Literal['general', 'tool', 'llm'], Any], required=True), 'usage': FieldInfo(annotation=Union[Dict[str, int], NoneType], required=False, default=None)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.