on_retriever_start() — langchain Function Reference
Architecture documentation for the on_retriever_start() function in manager.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 1a67808c_e69a_d19e_ad47_0b3b14d7a56a["on_retriever_start()"] 90ea8982_7d84_5e8f_4b5a_533f89fc7211["AsyncCallbackManager"] 1a67808c_e69a_d19e_ad47_0b3b14d7a56a -->|defined in| 90ea8982_7d84_5e8f_4b5a_533f89fc7211 bef424f7_9a20_c8f6_a6d0_29ffbe00b826["on_retriever_start()"] bef424f7_9a20_c8f6_a6d0_29ffbe00b826 -->|calls| 1a67808c_e69a_d19e_ad47_0b3b14d7a56a bef424f7_9a20_c8f6_a6d0_29ffbe00b826["on_retriever_start()"] 1a67808c_e69a_d19e_ad47_0b3b14d7a56a -->|calls| bef424f7_9a20_c8f6_a6d0_29ffbe00b826 3a243d21_72d1_dca9_f7be_acbb482b9f86["ahandle_event()"] 1a67808c_e69a_d19e_ad47_0b3b14d7a56a -->|calls| 3a243d21_72d1_dca9_f7be_acbb482b9f86 style 1a67808c_e69a_d19e_ad47_0b3b14d7a56a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/callbacks/manager.py lines 2082–2127
async def on_retriever_start(
self,
serialized: dict[str, Any] | None,
query: str,
run_id: UUID | None = None,
parent_run_id: UUID | None = None,
**kwargs: Any,
) -> AsyncCallbackManagerForRetrieverRun:
"""Run when the retriever starts running.
Args:
serialized: The serialized retriever.
query: The query.
run_id: The ID of the run.
parent_run_id: The ID of the parent run.
**kwargs: Additional keyword arguments.
Returns:
The async callback manager for the retriever run.
"""
if run_id is None:
run_id = uuid7()
await ahandle_event(
self.handlers,
"on_retriever_start",
"ignore_retriever",
serialized,
query,
run_id=run_id,
parent_run_id=self.parent_run_id,
tags=self.tags,
metadata=self.metadata,
**kwargs,
)
return AsyncCallbackManagerForRetrieverRun(
run_id=run_id,
handlers=self.handlers,
inheritable_handlers=self.inheritable_handlers,
parent_run_id=self.parent_run_id,
tags=self.tags,
inheritable_tags=self.inheritable_tags,
metadata=self.metadata,
inheritable_metadata=self.inheritable_metadata,
)
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does on_retriever_start() do?
on_retriever_start() is a function in the langchain codebase, defined in libs/core/langchain_core/callbacks/manager.py.
Where is on_retriever_start() defined?
on_retriever_start() is defined in libs/core/langchain_core/callbacks/manager.py at line 2082.
What does on_retriever_start() call?
on_retriever_start() calls 2 function(s): ahandle_event, on_retriever_start.
What calls on_retriever_start()?
on_retriever_start() is called by 1 function(s): on_retriever_start.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free