langchain.runnables.openai_functions.OpenAIFunctionsRouter¶
class langchain.runnables.openai_functions.OpenAIFunctionsRouter[source]¶
Bases: RunnableBinding[ChatGeneration, Any]
A runnable that routes to the selected function.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param bound: Runnable[Input, Output] [Required]¶
param config: Mapping[str, Any] [Optional]¶
param functions: Optional[List[langchain.runnables.openai_functions.OpenAIFunction]] = None¶
param kwargs: Mapping[str, Any] [Required]¶
async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Optional[Any]) → List[Output]¶
Default implementation of abatch, which calls ainvoke N times.
Subclasses should override this method if they can batch more efficiently.
async ainvoke(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Output¶
Default implementation of ainvoke, which calls invoke in a thread pool.
Subclasses should override this method if they can run asynchronously.
async astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶
Default implementation of astream, which calls ainvoke.
Subclasses should override this method if they support streaming output.