RuntimeOverrides(
self,
aio_to_thread: Optional[AioToThread] = None,
)| Name | Type | Description |
|---|---|---|
aio_to_thread | Optional[AioToThread] | Default: NoneCustom async-to-thread implementation, with signature
|
| Name | Type |
|---|---|
| aio_to_thread | Optional[AioToThread] |
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).
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)
langsmith.set_runtime_overrides()