# run_sse_stream

> **Function** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/sandbox/_sse_execute/run_sse_stream)

Start a command over SSE, yielding WebSocket-shaped message dicts.

Returns ``(messages, control)``. The iterator transparently re-requests the
stream whenever the server asks for an ack or the connection breaks, so the
caller sees one continuous run ending in an ``exit`` message.

## Signature

```python
run_sse_stream(
    http: httpx.Client,
    dataplane_url: str,
    payload: dict[str, Any],
    *,
    headers: Optional[Mapping[str, str]] = None,
) -> tuple[Iterator[dict], _SSEStreamControl]
```

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-sdk/blob/15468f97c18467d67ececb90b17107b0875e7a65/python/langsmith/sandbox/_sse_execute.py#L490)