Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chatkit/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions tests/helpers/mock_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down