asyncio.to_thread
Also written: to_thread
A Python function that runs an ordinary blocking function in a separate thread and lets you `await` its result. It allows blocking code, such as model or tool calls, to run in parallel inside asyncio programs.