# 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,
    *,
    command_id: str = '',
    timeout: int = 60,
    env: Optional[dict[str, str]] = None,
    cwd: Optional[str] = None,
    run_config: Optional[dict[str, Any]] = None,
    close_stdin: bool = False,
    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,
    open_timeout: Optional[float] = WS_OPEN_TIMEOUT,
) -> tuple[AsyncIterator[dict], _AsyncWSStreamControl]
```

---

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