Chain()Abstract base class for creating structured sequences of calls to components.
Chains should be used to encode a sequence of calls to components like models, document retrievers, other chains, etc., and provide a simple interface to this sequence.
The Chain interface makes it easy to create apps that are:
The main methods exposed by chains are:
__call__: Chains are callable. The __call__ method is the primary way to
execute a Chain. This takes inputs as a dictionary and returns a
dictionary output.run: A convenience method that takes inputs as args/kwargs and returns the
output as a string or object. This method can only be used for a subset of
chains and cannot return as rich of an output as __call__.