fix code review feedback for stream_events v3

This commit is contained in:
Nick Hollon
2026-04-30 14:30:54 -04:00
parent 9ab26d5e6d
commit 484a99a7cb

View File

@@ -1353,7 +1353,7 @@ class Runnable(ABC, Generic[Input, Output]):
exclude_types: Sequence[str] | None = None,
exclude_tags: Sequence[str] | None = None,
**kwargs: Any,
) -> AsyncIterator[StreamEvent]:
) -> AsyncIterator[StreamEvent] | AsyncIterator[Any]:
"""Generate a stream of events.
Use to create an iterator over `StreamEvent` that provide real-time information
@@ -1634,7 +1634,7 @@ class Runnable(ABC, Generic[Input, Output]):
exclude_types: Sequence[str] | None = None,
exclude_tags: Sequence[str] | None = None,
**kwargs: Any,
) -> Iterator[StreamEvent]:
) -> Iterator[StreamEvent] | Iterator[Any]:
"""Generate a stream of events synchronously.
Synchronous counterpart to `astream_events`. For `version='v3'`, subclasses
@@ -1659,9 +1659,6 @@ class Runnable(ABC, Generic[Input, Output]):
exclude_tags: Exclude events from `Runnable` objects with matching tags.
**kwargs: Additional keyword arguments to pass to the `Runnable`.
Yields:
A stream of events.
Raises:
NotImplementedError: Always. Subclasses override this method for supported
versions.