Home / Function/ OutputType() — langchain Function Reference

OutputType() — langchain Function Reference

Architecture documentation for the OutputType() function in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  da186838_9c3a_ab77_9c20_14f3911f4baa["OutputType()"]
  e155cd04_a39d_263a_c7f3_32e5830d204b["BaseOutputParser"]
  da186838_9c3a_ab77_9c20_14f3911f4baa -->|defined in| e155cd04_a39d_263a_c7f3_32e5830d204b
  1d40c00d_cdd6_2dc6_86ba_383f4e2f59e4["OutputType()"]
  1d40c00d_cdd6_2dc6_86ba_383f4e2f59e4 -->|calls| da186838_9c3a_ab77_9c20_14f3911f4baa
  1d40c00d_cdd6_2dc6_86ba_383f4e2f59e4["OutputType()"]
  da186838_9c3a_ab77_9c20_14f3911f4baa -->|calls| 1d40c00d_cdd6_2dc6_86ba_383f4e2f59e4
  style da186838_9c3a_ab77_9c20_14f3911f4baa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/output_parsers/base.py lines 179–197

    def OutputType(self) -> type[T]:
        """Return the output type for the parser.

        This property is inferred from the first type argument of the class.

        Raises:
            TypeError: If the class doesn't have an inferable `OutputType`.
        """
        for base in self.__class__.mro():
            if hasattr(base, "__pydantic_generic_metadata__"):
                metadata = base.__pydantic_generic_metadata__
                if "args" in metadata and len(metadata["args"]) > 0:
                    return cast("type[T]", metadata["args"][0])

        msg = (
            f"Runnable {self.__class__.__name__} doesn't have an inferable OutputType. "
            "Override the OutputType property to specify the output type."
        )
        raise TypeError(msg)

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

What does OutputType() do?
OutputType() is a function in the langchain codebase, defined in libs/core/langchain_core/output_parsers/base.py.
Where is OutputType() defined?
OutputType() is defined in libs/core/langchain_core/output_parsers/base.py at line 179.
What does OutputType() call?
OutputType() calls 1 function(s): OutputType.
What calls OutputType()?
OutputType() is called by 1 function(s): OutputType.

Analyze Your Own Codebase

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

Try Supermodel Free