Home / Function/ _get_tracer_project() — langchain Function Reference

_get_tracer_project() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  71c76bc1_1f57_b122_9d67_fd96e58f068a["_get_tracer_project()"]
  b631c948_af4b_1ae8_be2d_c334ff40ecef["context.py"]
  71c76bc1_1f57_b122_9d67_fd96e58f068a -->|defined in| b631c948_af4b_1ae8_be2d_c334ff40ecef
  f1271626_ef97_53db_898a_b2873112b894["_get_trace_callbacks()"]
  f1271626_ef97_53db_898a_b2873112b894 -->|calls| 71c76bc1_1f57_b122_9d67_fd96e58f068a
  style 71c76bc1_1f57_b122_9d67_fd96e58f068a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tracers/context.py lines 138–158

def _get_tracer_project() -> str:
    tracing_context = ls_rh.get_tracing_context()
    run_tree = tracing_context["parent"]
    if run_tree is None and tracing_context["project_name"] is not None:
        return cast("str", tracing_context["project_name"])
    return getattr(
        run_tree,
        "session_name",
        getattr(
            # Note, if people are trying to nest @traceable functions and the
            # tracing_v2_enabled context manager, this will likely mess up the
            # tree structure.
            tracing_v2_callback_var.get(),
            "project",
            # Have to set this to a string even though it always will return
            # a string because `get_tracer_project` technically can return
            # None, but only when a specific argument is supplied.
            # Therefore, this just tricks the mypy type checker
            str(ls_utils.get_tracer_project()),
        ),
    )

Domain

Subdomains

Frequently Asked Questions

What does _get_tracer_project() do?
_get_tracer_project() is a function in the langchain codebase, defined in libs/core/langchain_core/tracers/context.py.
Where is _get_tracer_project() defined?
_get_tracer_project() is defined in libs/core/langchain_core/tracers/context.py at line 138.
What calls _get_tracer_project()?
_get_tracer_project() is called by 1 function(s): _get_trace_callbacks.

Analyze Your Own Codebase

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

Try Supermodel Free