Streaming
Streaming manages real-time voice/avatar sessions and outbound campaigns over the streaming gateway. Use this resource to deploy streaming workflows, start sessions, and read transcripts and metrics.
Access it as client.streaming on a Strongly client, or the same path on AsyncStrongly with await. All methods exist on both with identical signatures.
Methods
Lifecycle & actions
deploy
deploy(workflow_id: str, *, cpu: str | None = None, memory: str | None = None, disk: str | None = None, gpu: str | None = None, gpu_type: str | None = None, idle_timeout_seconds: int | None = None, max_session_duration_seconds: int | None = None, max_concurrent_sessions: int | None = None, autoscaling: Mapping[str, Any] | None = None) -> StreamingDeployAccepted
Deploy a streaming workflow so it can accept sessions.
The deploy is queued (202): poll deployments(workflow_id) (or the
returned status_url) until it is deployed. The graph is checked
first; an invalid one is refused.
Parameters
workflow_id(str): The workflow id to deploy.cpu, memory(str | None, optional): Pod size, given together; leave both out to size the pod from the workflow's nodes.disk(str | None, optional): Pod disk, e.g. "5Gi".gpu(str | None, optional): GPU count as a string, e.g. "1".gpu_type(str | None, optional): GPU type when gpu is set.idle_timeout_seconds(int | None, optional): A session idle this long is ended (60-86400).max_session_duration_seconds(int | None, optional): A session is ended at this length (300-604800).max_concurrent_sessions(int | None, optional): Most sessions at once; a start beyond it is refused.autoscaling(Mapping[str, Any] | None, optional): {enabled, min_replicas, max_replicas, target_sessions_per_pod, scale_down_cooldown_seconds}. Off: one pod, started by the first session and stopped after the cooldown once idle. On: between min_replicas and max_replicas pods, one per target_sessions_per_pod sessions; min_replicas 0 scales to zero.
undeploy
undeploy(workflow_id: str) -> None
Undeploy a streaming workflow (graceful drain).
Other
end_session
end_session(session_id: str) -> None
End a streaming session (graceful drain).
errors
errors(session_id: str) -> list[StreamingErrorEvent]
Get errors emitted by the streaming-errors substrate for the session.
handoffs
handoffs(session_id: str) -> dict[str, Any]
Get multi-agent handoff history for a streaming session.
inject_message
inject_message(session_id: str, text: str, *, role: Role = "system") -> None
Inject a text message into an active session.
list_deployments
list_deployments(workflow_id: str) -> list[StreamingDeployment]
List deployment rows for a streaming workflow.
list_sessions
list_sessions(*, workflow_id: str | None = None, status: str | None = None, sort: str | None = None, limit: int | None = None) -> SyncPaginator[StreamingSession]
List the streaming sessions you can see, a page at a time as you iterate.
list_sessions_for_workflow
list_sessions_for_workflow(workflow_id: str, *, status: str | None = None, limit: int | None = None) -> SyncPaginator[StreamingSession]
List one streaming workflow's sessions, a page at a time as you iterate.
list_workflows
list_workflows(*, search: str | None = None, status: str | None = None, sort: str | None = None, limit: int | None = None) -> SyncPaginator[StreamingWorkflow]
List the streaming workflows you can use, a page at a time as you iterate.
session
session(session_id: str) -> StreamingSession
Get a single session by id.
start_session
start_session(workflow_id: str, *, metadata: dict[str, Any] | None = None, correlation_id: str | None = None, disposition_schema_version: str | None = None, mode: Literal['draft', 'production'] | None = None) -> SessionStartResult
Start a new streaming session. Returns session_id, ws_url and ws_token.
mode "production" runs the deployed version, "draft" the saved definition on your own builder worker; left out, a deployed workflow's session is production and an undeployed one's a draft. A caller inside the platform (an app) also gets public_ws_url, the address to hand to its browser users. The session starts pending while its pod starts; a connect to ws_url waits for the pod. If the pod can never start, the session fails with failure_reason "deployment_failed" (see get_session).
transcript
transcript(session_id: str, *, limit: int | None = None) -> SyncPaginator[TranscriptTurn]
List a session's transcript, oldest first, a page at a time as you iterate.
workflow
workflow(workflow_id: str) -> StreamingWorkflow
Get a single streaming workflow by id.