Skip to content

[FEATURE] Async Iterator - Typed Events #242

@pgrayy

Description

@pgrayy

Problem Statement

Currently, the events we pass to the callback handlers and also yield from our async iterator are not strongly typed. This makes it challenging for users to build conditions off the events for performing actions (e.g. printing model text chunks to screen). We should formalize the structure and strongly types these event payloads.

Proposed Solution

Solution is to implement interfaces for the Agent event payloads. Could be a dataclass, TypedDict, etc.

Use Case

To configure reliable conditions on the events for performing actions real-time (e.g., printing model text to screen in a chat application of Strands).

Alternatives Solutions

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

area-asyncRelated to asynchronous flows or multi-threadingenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions