test_complete_llm_run_handles_no_tool_calls() — langchain Function Reference
Architecture documentation for the test_complete_llm_run_handles_no_tool_calls() function in test_automatic_metadata.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 651ff256_a65f_8a1c_305f_4b8b8904c365["test_complete_llm_run_handles_no_tool_calls()"] c4a7a5fd_df82_7309_6533_bab19b148f74["test_automatic_metadata.py"] 651ff256_a65f_8a1c_305f_4b8b8904c365 -->|defined in| c4a7a5fd_df82_7309_6533_bab19b148f74 style 651ff256_a65f_8a1c_305f_4b8b8904c365 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/tracers/test_automatic_metadata.py lines 54–76
def test_complete_llm_run_handles_no_tool_calls() -> None:
"""Test that `_complete_llm_run` handles runs with no tool calls gracefully."""
tracer = MockTracerCore()
run = MagicMock(spec=Run)
run.id = "test-llm-run-id-no-tools"
run.run_type = "llm"
run.extra = {}
run.outputs = {}
run.events = []
run.end_time = None
run.inputs = {}
tracer.run_map[str(run.id)] = run
message = AIMessage(content="No tools here")
generation = ChatGeneration(message=message)
response = LLMResult(generations=[[generation]])
completed_run = tracer._complete_llm_run(response=response, run_id=run.id)
# Verify tool call count is not stored when there are no tool calls
assert "tool_call_count" not in completed_run.extra
Domain
Subdomains
Source
Frequently Asked Questions
What does test_complete_llm_run_handles_no_tool_calls() do?
test_complete_llm_run_handles_no_tool_calls() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/tracers/test_automatic_metadata.py.
Where is test_complete_llm_run_handles_no_tool_calls() defined?
test_complete_llm_run_handles_no_tool_calls() is defined in libs/core/tests/unit_tests/tracers/test_automatic_metadata.py at line 54.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free