Get a stream of events for a thread.
join_stream(
self,
thread_id: str,
*,
stream_mode: ThreadStreamMode | Sequence[ThreadStreamMode] = 'run_modes',
last_event_id: str | None = None,
headers: Mapping[str, str] | None = None,
params: QueryParamTypes | None = None
) -> Iterator[StreamPart]
for chunk in client.threads.join_stream(
thread_id="my_thread_id",
last_event_id="my_event_id",
stream_mode="run_modes",
):
print(chunk)| Name | Type | Description |
|---|---|---|
thread_id* | str | The ID of the thread to get the stream for. |
last_event_id | str | None | Default: NoneThe ID of the last event to get. |
headers | Mapping[str, str] | None | Default: NoneOptional custom headers to include with the request. |
params | QueryParamTypes | None | Default: NoneOptional query parameters to include with the request. |