# Stream with curl (use -N for unbuffered output)curl -N http://127.0.0.1:8005/api/v1/runs/run_abc123/stream
import httpxjob_id = "run_abc123"# Stream progress updateswith httpx.stream("GET", f"http://127.0.0.1:8005/api/v1/runs/{job_id}/stream") as response: for line in response.iter_lines(): if line.startswith("data:"): data = line[5:].strip() if data == "[DONE]": print("Stream complete") break import json event = json.loads(data) if event["event"] == "progress": pct = event["data"]["percentage"] step = event["data"].get("current_step", "") print(f"Progress: {pct}% - {step}") elif event["event"] == "log": print(f"Log: {event['data']['message']}") elif event["event"] == "complete": print(f"Complete: {event['data']['status']}")
import httpxfrom httpx_sse import connect_ssewith httpx.Client() as client: with connect_sse(client, "GET", f"http://127.0.0.1:8005/api/v1/runs/{job_id}/stream") as event_source: for sse in event_source.iter_sse(): if sse.data == "[DONE]": break print(f"Event: {sse.event}, Data: {sse.data}")
praisonai run stream run_abc123# JSON output (each line is a JSON event)praisonai run stream run_abc123 --json
Stream real-time progress updates via Server-Sent Events
GET
/
api
/
v1
/
runs
/
{job_id}
/
stream
# Stream with curl (use -N for unbuffered output)curl -N http://127.0.0.1:8005/api/v1/runs/run_abc123/stream
import httpxjob_id = "run_abc123"# Stream progress updateswith httpx.stream("GET", f"http://127.0.0.1:8005/api/v1/runs/{job_id}/stream") as response: for line in response.iter_lines(): if line.startswith("data:"): data = line[5:].strip() if data == "[DONE]": print("Stream complete") break import json event = json.loads(data) if event["event"] == "progress": pct = event["data"]["percentage"] step = event["data"].get("current_step", "") print(f"Progress: {pct}% - {step}") elif event["event"] == "log": print(f"Log: {event['data']['message']}") elif event["event"] == "complete": print(f"Complete: {event['data']['status']}")
import httpxfrom httpx_sse import connect_ssewith httpx.Client() as client: with connect_sse(client, "GET", f"http://127.0.0.1:8005/api/v1/runs/{job_id}/stream") as event_source: for sse in event_source.iter_sse(): if sse.data == "[DONE]": break print(f"Event: {sse.event}, Data: {sse.data}")
praisonai run stream run_abc123# JSON output (each line is a JSON event)praisonai run stream run_abc123 --json
# Stream with curl (use -N for unbuffered output)curl -N http://127.0.0.1:8005/api/v1/runs/run_abc123/stream
import httpxjob_id = "run_abc123"# Stream progress updateswith httpx.stream("GET", f"http://127.0.0.1:8005/api/v1/runs/{job_id}/stream") as response: for line in response.iter_lines(): if line.startswith("data:"): data = line[5:].strip() if data == "[DONE]": print("Stream complete") break import json event = json.loads(data) if event["event"] == "progress": pct = event["data"]["percentage"] step = event["data"].get("current_step", "") print(f"Progress: {pct}% - {step}") elif event["event"] == "log": print(f"Log: {event['data']['message']}") elif event["event"] == "complete": print(f"Complete: {event['data']['status']}")
import httpxfrom httpx_sse import connect_ssewith httpx.Client() as client: with connect_sse(client, "GET", f"http://127.0.0.1:8005/api/v1/runs/{job_id}/stream") as event_source: for sse in event_source.iter_sse(): if sse.data == "[DONE]": break print(f"Event: {sse.event}, Data: {sse.data}")
praisonai run stream run_abc123# JSON output (each line is a JSON event)praisonai run stream run_abc123 --json