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 2982d426_3118_c144_0d4b_d101dba16236["on_llm_start()"] 3b53de05_0697_704a_50e8_c5f9aaeba5ae["CallbackManagerMixin"] 2982d426_3118_c144_0d4b_d101dba16236 -->|defined in| 3b53de05_0697_704a_50e8_c5f9aaeba5ae d132e733_724f_f8b9_75ac_1de3b10fd868["on_llm_start()"] d132e733_724f_f8b9_75ac_1de3b10fd868 -->|calls| 2982d426_3118_c144_0d4b_d101dba16236 d132e733_724f_f8b9_75ac_1de3b10fd868["on_llm_start()"] 2982d426_3118_c144_0d4b_d101dba16236 -->|calls| d132e733_724f_f8b9_75ac_1de3b10fd868 style 2982d426_3118_c144_0d4b_d101dba16236 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/callbacks/base.py lines 241–268
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,
) -> Any:
"""Run when LLM 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 241.
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