Home / Function/ OutputType() — langchain Function Reference

OutputType() — langchain Function Reference

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

Function python LangChainCore Runnables calls 1 called by 2

Entity Profile

Dependency Diagram

graph TD
  fe5e92ef_6b27_0e9e_cba6_4e5b13a118db["OutputType()"]
  c6a370e4_a02a_c56a_38eb_7ca734dcbfea["RunnableLambda"]
  fe5e92ef_6b27_0e9e_cba6_4e5b13a118db -->|defined in| c6a370e4_a02a_c56a_38eb_7ca734dcbfea
  3159e045_8aa5_8375_e0ee_1bcff15b1e3d["OutputType()"]
  3159e045_8aa5_8375_e0ee_1bcff15b1e3d -->|calls| fe5e92ef_6b27_0e9e_cba6_4e5b13a118db
  14b1bd45_062f_c0d7_8215_9c0686171a9e["OutputType()"]
  14b1bd45_062f_c0d7_8215_9c0686171a9e -->|calls| fe5e92ef_6b27_0e9e_cba6_4e5b13a118db
  0218d516_e05e_7abb_bf3e_d2bc7c61365e["OutputType()"]
  fe5e92ef_6b27_0e9e_cba6_4e5b13a118db -->|calls| 0218d516_e05e_7abb_bf3e_d2bc7c61365e
  style fe5e92ef_6b27_0e9e_cba6_4e5b13a118db fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/runnables/base.py lines 4714–4734

    def OutputType(self) -> Any:
        """The type of the output of this `Runnable` as a type annotation.

        Returns:
            The type of the output of this `Runnable`.

        """
        func = getattr(self, "func", None) or self.afunc
        try:
            sig = inspect.signature(func)
            if sig.return_annotation != inspect.Signature.empty:
                # unwrap iterator types
                if getattr(sig.return_annotation, "__origin__", None) in {
                    collections.abc.Iterator,
                    collections.abc.AsyncIterator,
                }:
                    return getattr(sig.return_annotation, "__args__", (Any,))[0]
                return sig.return_annotation
        except ValueError:
            pass
        return Any

Domain

Subdomains

Calls

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free