coro_with_context#

langchain_core.runnables.utils.coro_with_context(
coro: Awaitable[Any],
context: Context,
*,
create_task: bool = False,
) Awaitable[Any][source]#

Await a coroutine with a context.

Parameters:
  • coro (Awaitable[Any]) – The coroutine to await.

  • context (Context) – The context to use.

  • create_task (bool) – Whether to create a task. Defaults to False.

Returns:

The coroutine with the context.

Return type:

Awaitable[Any]