Home / Function/ _call() — langchain Function Reference

_call() — langchain Function Reference

Architecture documentation for the _call() function in llms.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  862f8f36_13e4_466c_ffc2_266e2e8b78e4["_call()"]
  b2c7d2a5_0852_93df_c3e1_828c36a88999["LLM"]
  862f8f36_13e4_466c_ffc2_266e2e8b78e4 -->|defined in| b2c7d2a5_0852_93df_c3e1_828c36a88999
  1958c025_da10_4021_3597_57eb74b3eae7["_generate()"]
  1958c025_da10_4021_3597_57eb74b3eae7 -->|calls| 862f8f36_13e4_466c_ffc2_266e2e8b78e4
  style 862f8f36_13e4_466c_ffc2_266e2e8b78e4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/language_models/llms.py lines 1427–1453

    def _call(
        self,
        prompt: str,
        stop: list[str] | None = None,
        run_manager: CallbackManagerForLLMRun | None = None,
        **kwargs: Any,
    ) -> str:
        """Run the LLM on the given input.

        Override this method to implement the LLM logic.

        Args:
            prompt: The prompt to generate from.
            stop: Stop words to use when generating.

                Model output is cut off at the first occurrence of any of these
                substrings.

                If stop tokens are not supported consider raising `NotImplementedError`.
            run_manager: Callback manager for the run.
            **kwargs: Arbitrary additional keyword arguments.

                These are usually passed to the model provider API call.

        Returns:
            The model output as a string. SHOULD NOT include the prompt.
        """

Domain

Subdomains

Called By

Frequently Asked Questions

What does _call() do?
_call() is a function in the langchain codebase, defined in libs/core/langchain_core/language_models/llms.py.
Where is _call() defined?
_call() is defined in libs/core/langchain_core/language_models/llms.py at line 1427.
What calls _call()?
_call() is called by 1 function(s): _generate.

Analyze Your Own Codebase

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

Try Supermodel Free