],
        ],
    ) -> None:
        super().__init__(steps={key: coerce_to_runnable(r) for key, r in steps.items()})
[docs]    @classmethod
    def is_lc_serializable(cls) -> bool:
        return True
[docs]    @classmethod
    def get_lc_namespace(cls) -> List[str]:
        return cls.__module__.split(".")[:-1]
    class Config:
        arbitrary_types_allowed = True
    @property
    def InputType(self) -> Any:
        for step in self.steps.values():
            if step.InputType:
                return step.InputType
        return Any
    @property
    def input_schema(self) -> type[BaseModel]:
        if all(
            s.input_schema.schema().get("type", "object") == "object"
            for s in self.steps.values()
        ):
            # This is correct, but pydantic typings/mypy don't think so.
            return create_model(  # type: ignore[call-overload]
                "RunnableMapInput",
                **{
                    k: (v.type_, v.default)
                    for step in self.steps.values()
                    for k, v in step.input_schema.__fields__.items()
                    if k != "__root__"
                },
            )
        return super().input_schema
    @property
    def output_schema(self) -> type[BaseModel]:
        # This is correct, but pydantic typings/mypy don't think so.
        return create_model(  # type: ignore[call-overload]
            "RunnableMapOutput",
            **{k: (v.OutputType, None) for k, v in self.steps.items()},
        )
    def __repr__(self) -> str: