From 519bbf271ba685aa128015ffc23a2d451bb4907c Mon Sep 17 00:00:00 2001 From: Chris Kyle Date: Mon, 3 Nov 2025 09:59:55 -0500 Subject: [PATCH 1/2] Allow payloads on widget actions to be None --- chatkit/actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chatkit/actions.py b/chatkit/actions.py index 689a8f1..9357c95 100644 --- a/chatkit/actions.py +++ b/chatkit/actions.py @@ -24,7 +24,7 @@ class ActionConfig(BaseModel): class Action(BaseModel, Generic[TType, TPayload]): type: TType = Field(default=TType, frozen=True) # pyright: ignore - payload: TPayload + payload: TPayload | None = None @classmethod def create( From 2725f15468ff090675eae3836ebba37e15cec0b1 Mon Sep 17 00:00:00 2001 From: Chris Kyle Date: Mon, 3 Nov 2025 10:23:03 -0500 Subject: [PATCH 2/2] fix type errors --- tests/helpers/mock_widget.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/helpers/mock_widget.py b/tests/helpers/mock_widget.py index 2dde244..bd0dccd 100644 --- a/tests/helpers/mock_widget.py +++ b/tests/helpers/mock_widget.py @@ -615,6 +615,7 @@ async def handle_action( generate: Callable[[], AsyncIterator[ThreadStreamEvent]], save: Callable[[], AsyncIterator[ThreadStreamEvent]], ) -> AsyncIterator[ActionOutput]: + assert action.payload is not None, "Action payload is required" if action.type == "sample.show_widget": next_state = Index( selected=action.payload.widget,