Home / Function/ _start_trace() — langchain Function Reference

_start_trace() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  1a52c867_8259_f52c_1ade_c23b7b18c690["_start_trace()"]
  178590bb_85ff_b79e_979a_46e5c3c5389f["LangChainTracer"]
  1a52c867_8259_f52c_1ade_c23b7b18c690 -->|defined in| 178590bb_85ff_b79e_979a_46e5c3c5389f
  68b325b2_a4ee_6bd3_7e65_01239a5c497c["on_chat_model_start()"]
  68b325b2_a4ee_6bd3_7e65_01239a5c497c -->|calls| 1a52c867_8259_f52c_1ade_c23b7b18c690
  style 1a52c867_8259_f52c_1ade_c23b7b18c690 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tracers/langchain.py lines 137–150

    def _start_trace(self, run: Run) -> None:
        if self.project_name:
            run.session_name = self.project_name
        if self.tags is not None:
            if run.tags:
                run.tags = sorted(set(run.tags + self.tags))
            else:
                run.tags = self.tags.copy()

        super()._start_trace(run)
        if run.ls_client is None:
            run.ls_client = self.client
        if get_tracing_context().get("enabled") is False:
            run.extra["__disabled"] = True

Domain

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/langchain.py.
Where is _start_trace() defined?
_start_trace() is defined in libs/core/langchain_core/tracers/langchain.py at line 137.
What calls _start_trace()?
_start_trace() is called by 1 function(s): on_chat_model_start.

Analyze Your Own Codebase

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

Try Supermodel Free