Home / Function/ on_llm_start() — langchain Function Reference

on_llm_start() — langchain Function Reference

Architecture documentation for the on_llm_start() function in streaming_aiter.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  aa36850e_7d93_31b8_2615_527851110493["on_llm_start()"]
  026a405e_b843_1fc9_0384_15895a6c1500["AsyncIteratorCallbackHandler"]
  aa36850e_7d93_31b8_2615_527851110493 -->|defined in| 026a405e_b843_1fc9_0384_15895a6c1500
  style aa36850e_7d93_31b8_2615_527851110493 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/callbacks/streaming_aiter.py lines 32–39

    async def on_llm_start(
        self,
        serialized: dict[str, Any],
        prompts: list[str],
        **kwargs: Any,
    ) -> None:
        # If two calls are made in a row, this resets the state
        self.done.clear()

Domain

Subdomains

Frequently Asked Questions

What does on_llm_start() do?
on_llm_start() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/callbacks/streaming_aiter.py.
Where is on_llm_start() defined?
on_llm_start() is defined in libs/langchain/langchain_classic/callbacks/streaming_aiter.py at line 32.

Analyze Your Own Codebase

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

Try Supermodel Free