Default implementation runs invoke in parallel using a thread pool executor.
The default implementation of batch works well for IO bound runnables.
Subclasses must override this method if they can batch more efficiently;
e.g., if the underlying Runnable uses an API which supports a batch mode.
batch(
self,
inputs: list[Input],
config: RunnableConfig | list[RunnableConfig] | None = None,
*,
return_exceptions: bool = False,
**kwargs: Any | None = {}
) -> list[Output]| Name | Type | Description |
|---|---|---|
inputs* | list[Input] | A list of inputs to the |
config | RunnableConfig | list[RunnableConfig] | None | Default: NoneA config to use when invoking the Please refer to |
return_exceptions | bool | Default: FalseWhether to return exceptions instead of raising them. |
**kwargs | Any | None | Default: {}Additional keyword arguments to pass to the |