on_llm_start() — langchain Function Reference
Architecture documentation for the on_llm_start() function in base.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD d132e733_724f_f8b9_75ac_1de3b10fd868["on_llm_start()"] 64513429_d001_87b1_5f19_cc17a3f3577b["AsyncCallbackHandler"] d132e733_724f_f8b9_75ac_1de3b10fd868 -->|defined in| 64513429_d001_87b1_5f19_cc17a3f3577b 2982d426_3118_c144_0d4b_d101dba16236["on_llm_start()"] 2982d426_3118_c144_0d4b_d101dba16236 -->|calls| d132e733_724f_f8b9_75ac_1de3b10fd868 2982d426_3118_c144_0d4b_d101dba16236["on_llm_start()"] d132e733_724f_f8b9_75ac_1de3b10fd868 -->|calls| 2982d426_3118_c144_0d4b_d101dba16236 style d132e733_724f_f8b9_75ac_1de3b10fd868 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/callbacks/base.py lines 490–517
async def on_llm_start(
self,
serialized: dict[str, Any],
prompts: list[str],
*,
run_id: UUID,
parent_run_id: UUID | None = None,
tags: list[str] | None = None,
metadata: dict[str, Any] | None = None,
**kwargs: Any,
) -> None:
"""Run when the model starts running.
!!! warning
This method is called for non-chat models (regular text completion LLMs). If
you're implementing a handler for a chat model, you should use
`on_chat_model_start` instead.
Args:
serialized: The serialized LLM.
prompts: The prompts.
run_id: The ID of the current run.
parent_run_id: The ID of the parent run.
tags: The tags.
metadata: The metadata.
**kwargs: Additional keyword arguments.
"""
Domain
Subdomains
Defined In
Calls
Called By
Source
Frequently Asked Questions
What does on_llm_start() do?
on_llm_start() is a function in the langchain codebase, defined in libs/core/langchain_core/callbacks/base.py.
Where is on_llm_start() defined?
on_llm_start() is defined in libs/core/langchain_core/callbacks/base.py at line 490.
What does on_llm_start() call?
on_llm_start() calls 1 function(s): on_llm_start.
What calls on_llm_start()?
on_llm_start() is called by 1 function(s): on_llm_start.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free