llms.py — langchain Source File
Architecture documentation for llms.py, a python file in the langchain codebase. 24 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR a4692bf1_369d_4673_b1eb_6b9a8cbb9994["llms.py"] e6310202_b39e_ec9f_8b57_921c9c39c97d["asyncio"] a4692bf1_369d_4673_b1eb_6b9a8cbb9994 --> e6310202_b39e_ec9f_8b57_921c9c39c97d f46e1812_79f8_1bd0_7815_2ba4471dc470["functools"] a4692bf1_369d_4673_b1eb_6b9a8cbb9994 --> f46e1812_79f8_1bd0_7815_2ba4471dc470 589b2e2f_c593_ed0a_7906_df4ca371d542["inspect"] a4692bf1_369d_4673_b1eb_6b9a8cbb9994 --> 589b2e2f_c593_ed0a_7906_df4ca371d542 9d14ea65_8b2e_6721_a947_acc89905651f["json"] a4692bf1_369d_4673_b1eb_6b9a8cbb9994 --> 9d14ea65_8b2e_6721_a947_acc89905651f e27da29f_a1f7_49f3_84d5_6be4cb4125c8["logging"] a4692bf1_369d_4673_b1eb_6b9a8cbb9994 --> e27da29f_a1f7_49f3_84d5_6be4cb4125c8 50e20440_a135_6be3_a5a5_67791be5a2a6["abc"] a4692bf1_369d_4673_b1eb_6b9a8cbb9994 --> 50e20440_a135_6be3_a5a5_67791be5a2a6 2bf6d401_816d_d011_3b05_a6114f55ff58["collections.abc"] a4692bf1_369d_4673_b1eb_6b9a8cbb9994 --> 2bf6d401_816d_d011_3b05_a6114f55ff58 927570d8_11a6_5c17_0f0d_80baae0c733e["pathlib"] a4692bf1_369d_4673_b1eb_6b9a8cbb9994 --> 927570d8_11a6_5c17_0f0d_80baae0c733e feec1ec4_6917_867b_d228_b134d0ff8099["typing"] a4692bf1_369d_4673_b1eb_6b9a8cbb9994 --> feec1ec4_6917_867b_d228_b134d0ff8099 a869785a_d507_1688_0b32_0ec94043975a["yaml"] a4692bf1_369d_4673_b1eb_6b9a8cbb9994 --> a869785a_d507_1688_0b32_0ec94043975a dd5e7909_a646_84f1_497b_cae69735550e["pydantic"] a4692bf1_369d_4673_b1eb_6b9a8cbb9994 --> dd5e7909_a646_84f1_497b_cae69735550e 95c52e7f_10c7_6e61_0929_b2c359db94fd["tenacity"] a4692bf1_369d_4673_b1eb_6b9a8cbb9994 --> 95c52e7f_10c7_6e61_0929_b2c359db94fd f85fae70_1011_eaec_151c_4083140ae9e5["typing_extensions"] a4692bf1_369d_4673_b1eb_6b9a8cbb9994 --> f85fae70_1011_eaec_151c_4083140ae9e5 ddf7cb11_4d08_05dc_372b_51fc3beac85c["langchain_core.caches"] a4692bf1_369d_4673_b1eb_6b9a8cbb9994 --> ddf7cb11_4d08_05dc_372b_51fc3beac85c style a4692bf1_369d_4673_b1eb_6b9a8cbb9994 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"""Base interface for traditional large language models (LLMs) to expose.
These are traditionally older models (newer models generally are chat models).
"""
from __future__ import annotations
import asyncio
import functools
import inspect
import json
import logging
from abc import ABC, abstractmethod
from collections.abc import AsyncIterator, Callable, Iterator, Sequence
from pathlib import Path
from typing import (
TYPE_CHECKING,
Any,
cast,
)
import yaml
from pydantic import ConfigDict
from tenacity import (
RetryCallState,
before_sleep_log,
retry,
retry_base,
retry_if_exception_type,
stop_after_attempt,
wait_exponential,
)
from typing_extensions import override
from langchain_core.caches import BaseCache
from langchain_core.callbacks import (
AsyncCallbackManager,
AsyncCallbackManagerForLLMRun,
BaseCallbackManager,
CallbackManager,
CallbackManagerForLLMRun,
Callbacks,
)
from langchain_core.globals import get_llm_cache
from langchain_core.language_models.base import (
BaseLanguageModel,
LangSmithParams,
LanguageModelInput,
)
from langchain_core.load import dumpd
from langchain_core.messages import (
convert_to_messages,
)
from langchain_core.outputs import Generation, GenerationChunk, LLMResult, RunInfo
from langchain_core.prompt_values import ChatPromptValue, PromptValue, StringPromptValue
from langchain_core.runnables import RunnableConfig, ensure_config, get_config_list
from langchain_core.runnables.config import run_in_executor
if TYPE_CHECKING:
import uuid
// ... (1469 more lines)
Domain
Subdomains
Functions
Dependencies
- abc
- asyncio
- collections.abc
- functools
- inspect
- json
- langchain_core.caches
- langchain_core.callbacks
- langchain_core.globals
- langchain_core.language_models.base
- langchain_core.load
- langchain_core.messages
- langchain_core.outputs
- langchain_core.prompt_values
- langchain_core.runnables
- langchain_core.runnables.config
- logging
- pathlib
- pydantic
- tenacity
- typing
- typing_extensions
- uuid
- yaml
Source
Frequently Asked Questions
What does llms.py do?
llms.py is a source file in the langchain codebase, written in python. It belongs to the LangChainCore domain, LanguageModelBase subdomain.
What functions are defined in llms.py?
llms.py defines 8 function(s): _log_error_once, _resolve_cache, aget_prompts, aupdate_cache, create_base_retry_decorator, get_prompts, update_cache, uuid.
What does llms.py depend on?
llms.py imports 24 module(s): abc, asyncio, collections.abc, functools, inspect, json, langchain_core.caches, langchain_core.callbacks, and 16 more.
Where is llms.py in the architecture?
llms.py is located at libs/core/langchain_core/language_models/llms.py (domain: LangChainCore, subdomain: LanguageModelBase, directory: libs/core/langchain_core/language_models).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free