[docs]    def configurable_fields(
        self, **kwargs: AnyConfigurableField
    ) -> RunnableSerializable[Input, Output]:
        from langchain_core.runnables.configurable import RunnableConfigurableFields
        for key in kwargs:
            if key not in self.__fields__:
                raise ValueError(
                    f"Configuration key {key} not found in {self}: "
                    "available keys are {self.__fields__.keys()}"
                )
        return RunnableConfigurableFields(default=self, fields=kwargs)
[docs]    def configurable_alternatives(
        self,
        which: ConfigurableField,
        *,
        default_key: str = "default",
        prefix_keys: bool = False,
        **kwargs: Union[Runnable[Input, Output], Callable[[], Runnable[Input, Output]]],
    ) -> RunnableSerializable[Input, Output]:
        from langchain_core.runnables.configurable import (
            RunnableConfigurableAlternatives,
        )
        return RunnableConfigurableAlternatives(
            which=which,
            default=self,
            alternatives=kwargs,
            default_key=default_key,
            prefix_keys=prefix_keys,
        )
[docs]class RunnableSequence(RunnableSerializable[Input, Output]):
    """A sequence of runnables, where the output of each is the input of the next.
    RunnableSequence is the most important composition operator in LangChain as it is
    used in virtually every chain.
    A RunnableSequence can be instantiated directly or more commonly by using the `|`
    operator where either the left or right operands (or both) must be a Runnable.
    Any RunnableSequence automatically supports sync, async, batch.
    The default implementations of `batch` and `abatch` utilize threadpools and