Home / Function/ _start_trace() — langchain Function Reference

_start_trace() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  e13b9012_4ecf_ea58_ca69_498c9d8f26a2["_start_trace()"]
  6491c2d5_982b_c4f4_e268_52f0acf4d29b["AsyncBaseTracer"]
  e13b9012_4ecf_ea58_ca69_498c9d8f26a2 -->|defined in| 6491c2d5_982b_c4f4_e268_52f0acf4d29b
  3a237400_4e26_7f5e_6b01_5d6ba1c8afb5["_start_trace()"]
  3a237400_4e26_7f5e_6b01_5d6ba1c8afb5 -->|calls| e13b9012_4ecf_ea58_ca69_498c9d8f26a2
  9300c4a7_9421_2a7f_df2e_dfc93483a1f4["on_chat_model_start()"]
  9300c4a7_9421_2a7f_df2e_dfc93483a1f4 -->|calls| e13b9012_4ecf_ea58_ca69_498c9d8f26a2
  f92da0ac_7790_d83f_8e6b_ddb41dccaaa7["on_llm_start()"]
  f92da0ac_7790_d83f_8e6b_ddb41dccaaa7 -->|calls| e13b9012_4ecf_ea58_ca69_498c9d8f26a2
  21af7594_15e7_8da2_2dab_4022c348651c["on_chain_start()"]
  21af7594_15e7_8da2_2dab_4022c348651c -->|calls| e13b9012_4ecf_ea58_ca69_498c9d8f26a2
  dc163d47_2649_b6ca_833d_b60a683ca39d["on_tool_start()"]
  dc163d47_2649_b6ca_833d_b60a683ca39d -->|calls| e13b9012_4ecf_ea58_ca69_498c9d8f26a2
  b06c7165_f4c3_6bac_3bdf_c8f0032da741["on_retriever_start()"]
  b06c7165_f4c3_6bac_3bdf_c8f0032da741 -->|calls| e13b9012_4ecf_ea58_ca69_498c9d8f26a2
  9be1fe7e_50f2_1e1d_76fe_0d7b6d20aae6["_on_run_create()"]
  e13b9012_4ecf_ea58_ca69_498c9d8f26a2 -->|calls| 9be1fe7e_50f2_1e1d_76fe_0d7b6d20aae6
  3a237400_4e26_7f5e_6b01_5d6ba1c8afb5["_start_trace()"]
  e13b9012_4ecf_ea58_ca69_498c9d8f26a2 -->|calls| 3a237400_4e26_7f5e_6b01_5d6ba1c8afb5
  style e13b9012_4ecf_ea58_ca69_498c9d8f26a2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tracers/base.py lines 540–548

    async def _start_trace(self, run: Run) -> None:
        """Start a trace for a run.

        Starting a trace will run concurrently with each `_on_[run_type]_start` method.
        No `_on_[run_type]_start` callback should depend on operations in
        `_start_trace`.
        """
        super()._start_trace(run)
        await self._on_run_create(run)

Subdomains

Frequently Asked Questions

What does _start_trace() do?
_start_trace() is a function in the langchain codebase, defined in libs/core/langchain_core/tracers/base.py.
Where is _start_trace() defined?
_start_trace() is defined in libs/core/langchain_core/tracers/base.py at line 540.
What does _start_trace() call?
_start_trace() calls 2 function(s): _on_run_create, _start_trace.
What calls _start_trace()?
_start_trace() is called by 6 function(s): _start_trace, on_chain_start, on_chat_model_start, on_llm_start, on_retriever_start, on_tool_start.

Analyze Your Own Codebase

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

Try Supermodel Free