Home / Function/ is_llm() — langchain Function Reference

is_llm() — langchain Function Reference

Architecture documentation for the is_llm() function in prompt_selector.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  582f4e70_b60c_c652_abcd_853b75e00189["is_llm()"]
  caf93f27_6158_f36d_37c6_2a573c4bd8b9["prompt_selector.py"]
  582f4e70_b60c_c652_abcd_853b75e00189 -->|defined in| caf93f27_6158_f36d_37c6_2a573c4bd8b9
  style 582f4e70_b60c_c652_abcd_853b75e00189 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/chains/prompt_selector.py lines 44–53

def is_llm(llm: BaseLanguageModel) -> bool:
    """Check if the language model is a LLM.

    Args:
        llm: Language model to check.

    Returns:
        `True` if the language model is a BaseLLM model, `False` otherwise.
    """
    return isinstance(llm, BaseLLM)

Subdomains

Frequently Asked Questions

What does is_llm() do?
is_llm() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/chains/prompt_selector.py.
Where is is_llm() defined?
is_llm() is defined in libs/langchain/langchain_classic/chains/prompt_selector.py at line 44.

Analyze Your Own Codebase

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

Try Supermodel Free