Home / Function/ on_retriever_start() — langchain Function Reference

on_retriever_start() — langchain Function Reference

Architecture documentation for the on_retriever_start() function in base.py from the langchain codebase.

Function python Observability Tracers calls 3 called by 1

Entity Profile

Dependency Diagram

graph TD
  bf4d8a61_6642_64fa_e8e9_3dcdfaf802ca["on_retriever_start()"]
  0f6b3261_31fa_c34e_ca33_cb141bdf78ff["BaseTracer"]
  bf4d8a61_6642_64fa_e8e9_3dcdfaf802ca -->|defined in| 0f6b3261_31fa_c34e_ca33_cb141bdf78ff
  34d4aff3_df37_afe5_eda8_47ac51eeebe3["on_retriever_start()"]
  34d4aff3_df37_afe5_eda8_47ac51eeebe3 -->|calls| bf4d8a61_6642_64fa_e8e9_3dcdfaf802ca
  e367264b_d5e2_1e7f_2b3a_e362236bcd24["_start_trace()"]
  bf4d8a61_6642_64fa_e8e9_3dcdfaf802ca -->|calls| e367264b_d5e2_1e7f_2b3a_e362236bcd24
  936f68f6_447f_a14f_b3cf_7e3383599589["_on_retriever_start()"]
  bf4d8a61_6642_64fa_e8e9_3dcdfaf802ca -->|calls| 936f68f6_447f_a14f_b3cf_7e3383599589
  34d4aff3_df37_afe5_eda8_47ac51eeebe3["on_retriever_start()"]
  bf4d8a61_6642_64fa_e8e9_3dcdfaf802ca -->|calls| 34d4aff3_df37_afe5_eda8_47ac51eeebe3
  style bf4d8a61_6642_64fa_e8e9_3dcdfaf802ca fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tracers/base.py lines 433–472

    def on_retriever_start(
        self,
        serialized: dict[str, Any],
        query: str,
        *,
        run_id: UUID,
        parent_run_id: UUID | None = None,
        tags: list[str] | None = None,
        metadata: dict[str, Any] | None = None,
        name: str | None = None,
        **kwargs: Any,
    ) -> Run:
        """Run when the `Retriever` starts running.

        Args:
            serialized: The serialized retriever.
            query: The query.
            run_id: The run ID.
            parent_run_id: The parent run ID.
            tags: The tags for the run.
            metadata: The metadata for the run.
            name: The name of the run.
            **kwargs: Additional arguments.

        Returns:
            The run.
        """
        retrieval_run = self._create_retrieval_run(
            serialized=serialized,
            query=query,
            run_id=run_id,
            parent_run_id=parent_run_id,
            tags=tags,
            metadata=metadata,
            name=name,
            **kwargs,
        )
        self._start_trace(retrieval_run)
        self._on_retriever_start(retrieval_run)
        return retrieval_run

Domain

Subdomains

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/tracers/base.py.
Where is on_retriever_start() defined?
on_retriever_start() is defined in libs/core/langchain_core/tracers/base.py at line 433.
What does on_retriever_start() call?
on_retriever_start() calls 3 function(s): _on_retriever_start, _start_trace, 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