# run_ws_stream_async

> **Function** in `langsmith`

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

Async equivalent of run_ws_stream.

Returns (async_message_iterator, async_control).

## Signature

```python
run_ws_stream_async(
    dataplane_url: str,
    api_key: Optional[str],
    command: str,
    *,
    timeout: int = 60,
    env: Optional[dict[str, str]] = None,
    cwd: Optional[str] = None,
    shell: str = '/bin/bash',
    on_stdout: Optional[Callable[[str], Any]] = None,
    on_stderr: Optional[Callable[[str], Any]] = None,
    idle_timeout: int = 300,
    kill_on_disconnect: bool = False,
    ttl_seconds: int = 600,
    pty: bool = False,
    headers: Optional[Mapping[str, str]] = None,
) -> tuple[AsyncIterator[dict], _AsyncWSStreamControl]
```

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-sdk/blob/ce9e9e8973442b33e98ec3ce1b9c2dd3f58a43a7/python/langsmith/sandbox/_ws_execute.py#L407)