Skip to main content

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) -> StreamingWorkflow

Deploy a streaming workflow so it can accept sessions.

The deploy is queued (202): returns the workflow, deployment_status queued; poll list_deployments until a replica is ready. 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) -> StreamingWorkflow

Undeploy a streaming workflow (graceful drain); returns the workflow, back to draft.

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_recordings​

list_recordings(session_id: str, *, limit: int | None = None) -> SyncPaginator[StreamingRecording]

List a recorded streaming session's recordings (audio, transcript, manifest).

Parameters

  • session_id (str): The streaming session's ID.
  • limit (int | None, optional): The most recordings to return; all of them when omitted.

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.

session_logs​

session_logs(session_id: str, *, lines: int | None = None, container: str | None = None) -> dict[str, Any]

Get a streaming session's pod logs.

Parameters

  • session_id (str): The streaming session's ID.
  • lines (int | None, optional): How many of the latest lines (at most 2000).
  • container (str | None, optional): streaming-worker (the default), auth-proxy or egress-proxy.

session_status​

session_status(session_id: str) -> dict[str, Any]

Get a streaming session's live status, checked with its controller.

Parameters

  • session_id (str): The streaming session's 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.