Home / Function/ get_input_schema() — langchain Function Reference

get_input_schema() — langchain Function Reference

Architecture documentation for the get_input_schema() function in branch.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  0279c3b1_26ba_49d7_9e5e_72d76bf77816["get_input_schema()"]
  8c770be5_e4c6_a7e0_4227_c2085f2c1314["RunnableBranch"]
  0279c3b1_26ba_49d7_9e5e_72d76bf77816 -->|defined in| 8c770be5_e4c6_a7e0_4227_c2085f2c1314
  style 0279c3b1_26ba_49d7_9e5e_72d76bf77816 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/runnables/branch.py lines 159–173

    def get_input_schema(self, config: RunnableConfig | None = None) -> type[BaseModel]:
        runnables = (
            [self.default]
            + [r for _, r in self.branches]
            + [r for r, _ in self.branches]
        )

        for runnable in runnables:
            if (
                runnable.get_input_schema(config).model_json_schema().get("type")
                is not None
            ):
                return runnable.get_input_schema(config)

        return super().get_input_schema(config)

Domain

Subdomains

Frequently Asked Questions

What does get_input_schema() do?
get_input_schema() is a function in the langchain codebase, defined in libs/core/langchain_core/runnables/branch.py.
Where is get_input_schema() defined?
get_input_schema() is defined in libs/core/langchain_core/runnables/branch.py at line 159.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free