-
Notifications
You must be signed in to change notification settings - Fork 930
Open
Description
Bug Description
The Event union type in the Python SDK is missing the following event types that are defined as BaseEvent subclasses in the same module:
ThinkingStartEventThinkingEndEventThinkingTextMessageStartEventThinkingTextMessageContentEventThinkingTextMessageEndEvent
Steps to Reproduce
from pydantic import TypeAdapter
from ag_ui.core import Event
event_adapter = TypeAdapter(Event)
event_adapter.validate_python({'type': 'THINKING_START'})This raises a validation error:
Input tag 'THINKING_START' found using 'type' does not match any of the expected tags...
Expected Behavior
The Event union should include all BaseEvent subclasses so that thinking events can be properly deserialized.
Impact
This prevents using TypeAdapter[Event] when working with models that emit thinking events (e.g., Claude with extended thinking), as used by pydantic-ai's AGUIEventStream.
Proposed Fix
Add the missing thinking event types to the Event union in sdks/python/ag_ui/core/events.py.
Metadata
Metadata
Assignees
Labels
No labels