langchain.schema.runnable.RunnableWithFallbacks¶
class langchain.schema.runnable.RunnableWithFallbacks[source]¶
Bases: Serializable, Runnable[Input, Output]
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 exceptions_to_handle: Tuple[Type[BaseException]] = (<class 'Exception'>,)¶
param fallbacks: Sequence[langchain.schema.runnable.Runnable[langchain.schema.runnable.Input, langchain.schema.runnable.Output]] [Required]¶
param runnable: langchain.schema.runnable.Runnable[langchain.schema.runnable.Input, langchain.schema.runnable.Output] [Required]¶
async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, max_concurrency: Optional[int] = None) → List[Output][source]¶
async ainvoke(input: Input, config: Optional[RunnableConfig] = None) → Output[source]¶
async astream(input: Input, config: Optional[RunnableConfig] = None) → AsyncIterator[Output]¶
batch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, max_concurrency: Optional[int] = None) → List[Output][source]¶
bind(**kwargs: Any) → Runnable[Input, Output]¶
Bind arguments to a Runnable, returning a new Runnable.
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values