langchain_core.runnables.config.run_in_executorΒΆ

async langchain_core.runnables.config.run_in_executor(executor_or_config: ~typing.Optional[~typing.Union[~concurrent.futures._base.Executor, ~langchain_core.runnables.config.RunnableConfig]], func: ~typing.Callable[[~P], ~langchain_core.runnables.config.T], *args: ~typing.~P, **kwargs: ~typing.~P) T[source]ΒΆ

Run a function in an executor.

Parameters
  • executor (Executor) – The executor.

  • func (Callable[P, Output]) – The function.

  • *args (Any) – The positional arguments to the function.

  • **kwargs (Any) – The keyword arguments to the function.

Returns

The output of the function.

Return type

Output