Skip to content

Commit 5ac0738

Browse files
committed
fix type
1 parent 10dfb55 commit 5ac0738

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

py/packages/genkit/src/genkit/core/typing.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,12 @@ class Index(RootModel[float]):
606606
root: float
607607

608608

609+
class TraceId(RootModel[str]):
610+
"""Root model for traceid."""
611+
612+
root: str
613+
614+
609615
class EmbedResponse(BaseModel):
610616
"""Model for embedresponse data."""
611617

@@ -787,17 +793,25 @@ class SpanEndEvent(BaseModel):
787793
"""Model for spanendevent data."""
788794

789795
model_config = ConfigDict(extra='forbid', populate_by_name=True)
790-
type: Literal['span_end']
791796
trace_id: str = Field(..., alias='traceId')
792797
span: SpanData
798+
type: Literal['span_end']
793799

794800

795801
class SpanStartEvent(BaseModel):
796802
"""Model for spanstartevent data."""
797803

798804
model_config = ConfigDict(extra='forbid', populate_by_name=True)
805+
trace_id: TraceId = Field(..., alias='traceId')
806+
span: SpanData
799807
type: Literal['span_start']
800-
trace_id: str = Field(..., alias='traceId')
808+
809+
810+
class SpantEventBase(BaseModel):
811+
"""Model for spanteventbase data."""
812+
813+
model_config = ConfigDict(extra='forbid', populate_by_name=True)
814+
trace_id: TraceId = Field(..., alias='traceId')
801815
span: SpanData
802816

803817

0 commit comments

Comments
 (0)