Create a run and stream the results.
This method calls POST /threads/{thread_id}/runs/stream if a thread_id
is speciffed in the configurable field of the config or
POST /runs/stream otherwise.
stream(
self,
input: dict[str, Any] | Any,
config: RunnableConfig | None = None,
*,
stream_mode: StreamMode | list[StreamMode] | None = None,
interrupt_before: All | Sequence[str] | None = None,
interrupt_after: All | Sequence[str] | None = None,
subgraphs: bool = False,
headers: dict[str, str] | None = None,
params: QueryParamTypes | None = None,
**kwargs: Any = {}
) -> Iterator[dict[str, Any] | Any]| Name | Type | Description |
|---|---|---|
input* | dict[str, Any] | Any | Input to the graph. |
config | RunnableConfig | None | Default: NoneA |
stream_mode | StreamMode | list[StreamMode] | None | Default: NoneStream mode(s) to use. |
interrupt_before | All | Sequence[str] | None | Default: NoneInterrupt the graph before these nodes. |
interrupt_after | All | Sequence[str] | None | Default: NoneInterrupt the graph after these nodes. |
subgraphs | bool | Default: FalseStream from subgraphs. |
headers | dict[str, str] | None | Default: NoneAdditional headers to pass to the request. |
**kwargs | Any | Default: {}Additional params to pass to client.runs.stream. |