Home / Function/ _complete_tool_run() — langchain Function Reference

_complete_tool_run() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  a4743e46_b363_90d0_b3d0_fb9c5a668a1c["_complete_tool_run()"]
  70348e44_de0f_ccb4_c06a_8453289ed93e["_TracerCore"]
  a4743e46_b363_90d0_b3d0_fb9c5a668a1c -->|defined in| 70348e44_de0f_ccb4_c06a_8453289ed93e
  66392709_99c4_1a2e_dfac_aed34eebe5f5["_get_run()"]
  a4743e46_b363_90d0_b3d0_fb9c5a668a1c -->|calls| 66392709_99c4_1a2e_dfac_aed34eebe5f5
  style a4743e46_b363_90d0_b3d0_fb9c5a668a1c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tracers/core.py lines 455–468

    def _complete_tool_run(
        self,
        output: dict[str, Any],
        run_id: UUID,
    ) -> Run:
        """Update a tool run with outputs and end time."""
        tool_run = self._get_run(run_id, run_type="tool")
        if getattr(tool_run, "outputs", None) is None:
            tool_run.outputs = {}
        if not tool_run.extra.get("__omit_auto_outputs", False):
            cast("dict[str, Any]", tool_run.outputs).update({"output": output})
        tool_run.end_time = datetime.now(timezone.utc)
        tool_run.events.append({"name": "end", "time": tool_run.end_time})
        return tool_run

Domain

Subdomains

Calls

Frequently Asked Questions

What does _complete_tool_run() do?
_complete_tool_run() is a function in the langchain codebase, defined in libs/core/langchain_core/tracers/core.py.
Where is _complete_tool_run() defined?
_complete_tool_run() is defined in libs/core/langchain_core/tracers/core.py at line 455.
What does _complete_tool_run() call?
_complete_tool_run() calls 1 function(s): _get_run.

Analyze Your Own Codebase

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

Try Supermodel Free