"Use `ainvoke` instead."
            )
[docs]    async def ainvoke(
        self,
        input: Input,
        config: Optional[RunnableConfig] = None,
        **kwargs: Optional[Any],
    ) -> Output:
        if hasattr(self, "afunc"):
            return await self._acall_with_config(
                self._ainvoke,
                input,
                self._config(config, self.afunc),
            )
        else:
            # Delegating to super implementation of ainvoke.
            # Uses asyncio executor to run the sync version (invoke)
            return await super().ainvoke(input, config)
[docs]class RunnableEach(Serializable, Runnable[List[Input], List[Output]]):
    """
    A runnable that delegates calls to another runnable
    with each element of the input sequence.
    """
    bound: Runnable[Input, Output]
    class Config:
        arbitrary_types_allowed = True
    @property
    def InputType(self) -> Any:
        return List[self.bound.InputType]  # type: ignore[name-defined]
    @property
    def input_schema(self) -> type[BaseModel]:
        return create_model(
            "RunnableEachInput",
            __root__=(
                List[self.bound.input_schema],  # type: ignore[name-defined]
                None,
            ),
        )
    @property
    def OutputType(self) -> type[List[Output]]:
        return List[self.bound.OutputType]  # type: ignore[name-defined]
    @property
    def output_schema(self) -> type[BaseModel]:
        return create_model(
            "RunnableEachOutput",
            __root__=(