@@ -87,24 +87,20 @@ class ThinkingTextMessageStartEvent(BaseEvent):
87
87
"""
88
88
Event indicating the start of a thinking text message.
89
89
"""
90
- type : Literal [EventType .THINKING_TEXT_MESSAGE_START ]
90
+ type : Literal [EventType .THINKING_TEXT_MESSAGE_START ] = EventType . THINKING_TEXT_MESSAGE_START # pyright: ignore[reportIncompatibleVariableOverride]
91
91
92
92
class ThinkingTextMessageContentEvent (BaseEvent ):
93
93
"""
94
94
Event indicating a piece of a thinking text message.
95
95
"""
96
- type : Literal [EventType .THINKING_TEXT_MESSAGE_CONTENT ]
97
- delta : str # This should not be an empty string
98
-
99
- def model_post_init (self , __context ):
100
- if len (self .delta ) == 0 :
101
- raise ValueError ("Delta must not be an empty string" )
96
+ type : Literal [EventType .THINKING_TEXT_MESSAGE_CONTENT ] = EventType .THINKING_TEXT_MESSAGE_CONTENT # pyright: ignore[reportIncompatibleVariableOverride]
97
+ delta : str = Field (min_length = 1 )
102
98
103
99
class ThinkingTextMessageEndEvent (BaseEvent ):
104
100
"""
105
101
Event indicating the end of a thinking text message.
106
102
"""
107
- type : Literal [EventType .THINKING_TEXT_MESSAGE_END ]
103
+ type : Literal [EventType .THINKING_TEXT_MESSAGE_END ] = EventType . THINKING_TEXT_MESSAGE_END # pyright: ignore[reportIncompatibleVariableOverride]
108
104
109
105
class ToolCallStartEvent (BaseEvent ):
110
106
"""
@@ -147,7 +143,7 @@ class ToolCallResultEvent(BaseEvent):
147
143
Event containing the result of a tool call.
148
144
"""
149
145
message_id : str
150
- type : Literal [EventType .TOOL_CALL_RESULT ]
146
+ type : Literal [EventType .TOOL_CALL_RESULT ] = EventType . TOOL_CALL_RESULT # pyright: ignore[reportIncompatibleVariableOverride]
151
147
tool_call_id : str
152
148
content : str
153
149
role : Optional [Literal ["tool" ]] = None
@@ -156,14 +152,14 @@ class ThinkingStartEvent(BaseEvent):
156
152
"""
157
153
Event indicating the start of a thinking step event.
158
154
"""
159
- type : Literal [EventType .THINKING_START ]
155
+ type : Literal [EventType .THINKING_START ] = EventType . THINKING_START # pyright: ignore[reportIncompatibleVariableOverride]
160
156
title : Optional [str ] = None
161
157
162
158
class ThinkingEndEvent (BaseEvent ):
163
159
"""
164
160
Event indicating the end of a thinking step event.
165
161
"""
166
- type : Literal [EventType .THINKING_END ]
162
+ type : Literal [EventType .THINKING_END ] = EventType . THINKING_END # pyright: ignore[reportIncompatibleVariableOverride]
167
163
168
164
class StateSnapshotEvent (BaseEvent ):
169
165
"""
0 commit comments