68
68
TextMessageContentEvent ,
69
69
TextMessageEndEvent ,
70
70
TextMessageStartEvent ,
71
- # TODO: Enable once https://github.com/ag-ui-protocol/ag-ui/issues/289 is resolved.
72
- # ThinkingEndEvent,
73
- # ThinkingStartEvent,
71
+ ThinkingEndEvent ,
72
+ ThinkingStartEvent ,
74
73
ThinkingTextMessageContentEvent ,
75
74
ThinkingTextMessageEndEvent ,
76
75
ThinkingTextMessageStartEvent ,
@@ -396,10 +395,9 @@ async def _agent_stream(run: AgentRun[AgentDepsT, Any]) -> AsyncIterator[BaseEve
396
395
yield stream_ctx .part_end
397
396
stream_ctx .part_end = None
398
397
if stream_ctx .thinking :
399
- # TODO: Enable once https://github.com/ag-ui-protocol/ag-ui/issues/289 is resolved.
400
- # yield ThinkingEndEvent(
401
- # type=EventType.THINKING_END,
402
- # )
398
+ yield ThinkingEndEvent (
399
+ type = EventType .THINKING_END ,
400
+ )
403
401
stream_ctx .thinking = False
404
402
elif isinstance (node , CallToolsNode ):
405
403
async with node .stream (run .ctx ) as handle_stream :
@@ -431,10 +429,9 @@ async def _handle_model_request_event( # noqa: C901
431
429
part = agent_event .part
432
430
if isinstance (part , ThinkingPart ): # pragma: no branch
433
431
if not stream_ctx .thinking :
434
- # TODO: Enable once https://github.com/ag-ui-protocol/ag-ui/issues/289 is resolved.
435
- # yield ThinkingStartEvent(
436
- # type=EventType.THINKING_START,
437
- # )
432
+ yield ThinkingStartEvent (
433
+ type = EventType .THINKING_START ,
434
+ )
438
435
stream_ctx .thinking = True
439
436
440
437
if part .content :
@@ -450,10 +447,9 @@ async def _handle_model_request_event( # noqa: C901
450
447
)
451
448
else :
452
449
if stream_ctx .thinking :
453
- # TODO: Enable once https://github.com/ag-ui-protocol/ag-ui/issues/289 is resolved.
454
- # yield ThinkingEndEvent(
455
- # type=EventType.THINKING_END,
456
- # )
450
+ yield ThinkingEndEvent (
451
+ type = EventType .THINKING_END ,
452
+ )
457
453
stream_ctx .thinking = False
458
454
459
455
if isinstance (part , TextPart ):
0 commit comments