Home / Function/ __or__() — langchain Function Reference

__or__() — langchain Function Reference

Architecture documentation for the __or__() function in structured.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  c93652b8_42d7_bf97_e416_56bd747ea444["__or__()"]
  14de95af_eb88_e7a8_1ab1_98d03dd541e0["StructuredPrompt"]
  c93652b8_42d7_bf97_e416_56bd747ea444 -->|defined in| 14de95af_eb88_e7a8_1ab1_98d03dd541e0
  aa20e50e_3f08_075e_f059_e71b8aad4032["pipe()"]
  c93652b8_42d7_bf97_e416_56bd747ea444 -->|calls| aa20e50e_3f08_075e_f059_e71b8aad4032
  style c93652b8_42d7_bf97_e416_56bd747ea444 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/prompts/structured.py lines 139–147

    def __or__(
        self,
        other: Runnable[Any, Other]
        | Callable[[Iterator[Any]], Iterator[Other]]
        | Callable[[AsyncIterator[Any]], AsyncIterator[Other]]
        | Callable[[Any], Other]
        | Mapping[str, Runnable[Any, Other] | Callable[[Any], Other] | Any],
    ) -> RunnableSerializable[dict, Other]:
        return self.pipe(other)

Subdomains

Calls

Frequently Asked Questions

What does __or__() do?
__or__() is a function in the langchain codebase, defined in libs/core/langchain_core/prompts/structured.py.
Where is __or__() defined?
__or__() is defined in libs/core/langchain_core/prompts/structured.py at line 139.
What does __or__() call?
__or__() calls 1 function(s): pipe.

Analyze Your Own Codebase

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

Try Supermodel Free