test_tracer_tool_run_on_error() — langchain Function Reference
Architecture documentation for the test_tracer_tool_run_on_error() function in test_async_base_tracer.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD da60ea08_1883_7791_77a3_237d7ab52696["test_tracer_tool_run_on_error()"] a49e8dc2_b2f8_294c_51a9_1a3ea21182fb["test_async_base_tracer.py"] da60ea08_1883_7791_77a3_237d7ab52696 -->|defined in| a49e8dc2_b2f8_294c_51a9_1a3ea21182fb 0964cd32_f826_4bb4_e380_fe8ef2770b89["_compare_run_with_error()"] da60ea08_1883_7791_77a3_237d7ab52696 -->|calls| 0964cd32_f826_4bb4_e380_fe8ef2770b89 style da60ea08_1883_7791_77a3_237d7ab52696 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/tracers/test_async_base_tracer.py lines 437–466
async def test_tracer_tool_run_on_error() -> None:
"""Test tracer on a Tool run with an error."""
exception = Exception("test")
uuid = uuid4()
compare_run = Run(
id=str(uuid),
name="tool",
start_time=datetime.now(timezone.utc),
end_time=datetime.now(timezone.utc),
events=[
{"name": "start", "time": datetime.now(timezone.utc)},
{"name": "error", "time": datetime.now(timezone.utc)},
],
extra={},
serialized={"name": "tool"},
inputs={"input": "test"},
outputs=None,
error=repr(exception),
run_type="tool",
trace_id=uuid,
dotted_order=f"20230101T000000000000Z{uuid}",
)
tracer = FakeAsyncTracer()
await tracer.on_tool_start(
serialized={"name": "tool"}, input_str="test", run_id=uuid
)
await tracer.on_tool_error(exception, run_id=uuid)
_compare_run_with_error(tracer.runs[0], compare_run)
Domain
Subdomains
Source
Frequently Asked Questions
What does test_tracer_tool_run_on_error() do?
test_tracer_tool_run_on_error() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/tracers/test_async_base_tracer.py.
Where is test_tracer_tool_run_on_error() defined?
test_tracer_tool_run_on_error() is defined in libs/core/tests/unit_tests/tracers/test_async_base_tracer.py at line 437.
What does test_tracer_tool_run_on_error() call?
test_tracer_tool_run_on_error() calls 1 function(s): _compare_run_with_error.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free