Skip to main content
The make_async function takes a synchronous function (for instance a LangChain agent) and returns an asynchronous function that will run the original function in a separate thread. This is useful to run long running synchronous tasks without blocking the event loop.

Parameters

Callable
The synchronous function to run in a separate thread.

Returns

Coroutine
required
The asynchronous function that will run the synchronous function in a separate thread.

Usage

LangChain agent