on_retriever_end() — langchain Function Reference
Architecture documentation for the on_retriever_end() function in event_stream.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 897d2824_f0e5_bf67_e249_f7993c8f78bb["on_retriever_end()"] 33d093c4_1ed0_fc6a_17c6_762d4c5cfa04["_AstreamEventsCallbackHandler"] 897d2824_f0e5_bf67_e249_f7993c8f78bb -->|defined in| 33d093c4_1ed0_fc6a_17c6_762d4c5cfa04 87f79bee_f9c5_8262_1829_62f633c4f870["_send()"] 897d2824_f0e5_bf67_e249_f7993c8f78bb -->|calls| 87f79bee_f9c5_8262_1829_62f633c4f870 9aed8e4f_9d4c_016f_aa43_c5908015cf8d["_get_parent_ids()"] 897d2824_f0e5_bf67_e249_f7993c8f78bb -->|calls| 9aed8e4f_9d4c_016f_aa43_c5908015cf8d style 897d2824_f0e5_bf67_e249_f7993c8f78bb fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/tracers/event_stream.py lines 796–816
async def on_retriever_end(
self, documents: Sequence[Document], *, run_id: UUID, **kwargs: Any
) -> None:
"""Run when `Retriever` ends running."""
run_info = self.run_map.pop(run_id)
self._send(
{
"event": "on_retriever_end",
"data": {
"output": documents,
"input": run_info.get("inputs"),
},
"run_id": str(run_id),
"name": run_info["name"],
"tags": run_info["tags"],
"metadata": run_info["metadata"],
"parent_ids": self._get_parent_ids(run_id),
},
run_info["run_type"],
)
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does on_retriever_end() do?
on_retriever_end() is a function in the langchain codebase, defined in libs/core/langchain_core/tracers/event_stream.py.
Where is on_retriever_end() defined?
on_retriever_end() is defined in libs/core/langchain_core/tracers/event_stream.py at line 796.
What does on_retriever_end() call?
on_retriever_end() calls 2 function(s): _get_parent_ids, _send.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free