@@ -17,10 +17,15 @@ class EventType(str, Enum):
1717 TEXT_MESSAGE_CONTENT = "TEXT_MESSAGE_CONTENT"
1818 TEXT_MESSAGE_END = "TEXT_MESSAGE_END"
1919 TEXT_MESSAGE_CHUNK = "TEXT_MESSAGE_CHUNK"
20+ THINKING_TEXT_MESSAGE_START = "THINKING_TEXT_MESSAGE_START" ,
21+ THINKING_TEXT_MESSAGE_CONTENT = "THINKING_TEXT_MESSAGE_CONTENT" ,
22+ THINKING_TEXT_MESSAGE_END = "THINKING_TEXT_MESSAGE_END" ,
2023 TOOL_CALL_START = "TOOL_CALL_START"
2124 TOOL_CALL_ARGS = "TOOL_CALL_ARGS"
2225 TOOL_CALL_END = "TOOL_CALL_END"
2326 TOOL_CALL_CHUNK = "TOOL_CALL_CHUNK"
27+ THINKING_START = "THINKING_START" ,
28+ THINKING_END = "THINKING_END" ,
2429 STATE_SNAPSHOT = "STATE_SNAPSHOT"
2530 STATE_DELTA = "STATE_DELTA"
2631 MESSAGES_SNAPSHOT = "MESSAGES_SNAPSHOT"
@@ -80,6 +85,29 @@ class TextMessageChunkEvent(BaseEvent):
8085 role : Optional [Literal ["assistant" ]] = None
8186 delta : Optional [str ] = None
8287
88+ class ThinkingTextMessageStartEvent (BaseEvent ):
89+ """
90+ Event indicating the start of a thinking text message.
91+ """
92+ type : Literal [EventType .THINKING_TEXT_MESSAGE_START ]
93+
94+ class ThinkingTextMessageContentEvent (BaseEvent ):
95+ """
96+ Event indicating a piece of a thinking text message.
97+ """
98+ type : Literal [EventType .THINKING_TEXT_MESSAGE_CONTENT ]
99+ delta : str # This should not be an empty string
100+
101+ def model_post_init (self , __context ):
102+ if len (self .delta ) == 0 :
103+ raise ValueError ("Delta must not be an empty string" )
104+
105+ class ThinkingTextMessageEndEvent (BaseEvent ):
106+ """
107+ Event indicating the end of a thinking text message.
108+ """
109+ type : Literal [EventType .THINKING_TEXT_MESSAGE_END ]
110+
83111class ToolCallStartEvent (BaseEvent ):
84112 """
85113 Event indicating the start of a tool call.
@@ -116,6 +144,18 @@ class ToolCallChunkEvent(BaseEvent):
116144 parent_message_id : Optional [str ] = None
117145 delta : Optional [str ] = None
118146
147+ class ThinkingStartEvent (BaseEvent ):
148+ """
149+ Event indicating the start of a thinking step event.
150+ """
151+ type : Literal [EventType .THINKING_START ]
152+
153+ class ThinkingEndEvent (BaseEvent ):
154+ """
155+ Event indicating the end of a thinking step event.
156+ """
157+ type : Literal [EventType .THINKING_END ]
158+
119159class StateSnapshotEvent (BaseEvent ):
120160 """
121161 Event containing a snapshot of the state.
0 commit comments