# RuntimeOverrides

> **Class** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/_runtime_overrides/RuntimeOverrides)

Overrides for LangSmith runtime behavior.

This class allows overriding default async implementations for environments
that don't support certain asyncio features (e.g., Temporal doesn't support
``run_in_executor``).

## Signature

```python
RuntimeOverrides(
    self,
    aio_to_thread: Optional[AioToThread] = None,
)
```

## Description

**Example:**

import langsmith
import contextvars

async def my_aio_to_thread(
    default_aio_to_thread, ctx, func, /, *args, **kwargs
):
    # Custom implementation
    return ctx.run(func, *args, **kwargs)

langsmith.set_runtime_overrides(aio_to_thread=my_aio_to_thread)

# Reset to defaults
langsmith.set_runtime_overrides()

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `aio_to_thread` | `Optional[AioToThread]` | No | Custom async-to-thread implementation, with signature ``async def (default_aio_to_thread, ctx, func, /, *args, **kwargs)``. ``default_aio_to_thread`` is LangSmith's default implementation, which the override can call to fall back to default behavior (e.g., when outside a constrained runtime context). ``ctx`` is the ``contextvars.Context`` LangSmith wants ``func`` to run inside; tracing state will be read back from this Context after the call. Override for runtimes like Temporal that don't support ``asyncio.run_in_executor``. (default: `None`) |

## Constructors

```python
__init__(
    self,
    aio_to_thread: Optional[AioToThread] = None,
)
```

| Name | Type |
|------|------|
| `aio_to_thread` | `Optional[AioToThread]` |


## Properties

- `aio_to_thread`

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-sdk/blob/70260f8db5b02e286a22f9524fba283a2513859a/python/langsmith/_runtime_overrides.py#L21)