test_non_emulated_tools_execute_normally() — langchain Function Reference
Architecture documentation for the test_non_emulated_tools_execute_normally() function in test_tool_emulator.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD cf50a1c8_6424_5097_ee7e_7e20e3669a80["test_non_emulated_tools_execute_normally()"] f4edbff2_7ddf_8a09_14d8_c5faf6609d38["TestLLMToolEmulatorBasic"] cf50a1c8_6424_5097_ee7e_7e20e3669a80 -->|defined in| f4edbff2_7ddf_8a09_14d8_c5faf6609d38 style cf50a1c8_6424_5097_ee7e_7e20e3669a80 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_tool_emulator.py lines 182–216
def test_non_emulated_tools_execute_normally(self) -> None:
"""Test that tools not in tools_to_emulate execute normally."""
agent_model = FakeModel(
messages=cycle(
[
AIMessage(
content="",
tool_calls=[
{"name": "calculator", "id": "1", "args": {"expression": "2+2"}}
],
),
AIMessage(content="The calculation is complete."),
]
)
)
emulator_model = FakeEmulatorModel(responses=["Should not be used"])
# Only emulate get_weather, not calculator
emulator = LLMToolEmulator(tools=["get_weather"], model=emulator_model)
agent = create_agent(
model=agent_model,
tools=[get_weather, calculator],
middleware=[emulator],
)
result = agent.invoke({"messages": [HumanMessage("Calculate 2+2")]})
# Calculator should execute normally and return Result: 4
tool_messages = [
msg for msg in result["messages"] if hasattr(msg, "name") and msg.name == "calculator"
]
assert len(tool_messages) > 0
assert "Result: 4" in tool_messages[0].content
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does test_non_emulated_tools_execute_normally() do?
test_non_emulated_tools_execute_normally() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_tool_emulator.py.
Where is test_non_emulated_tools_execute_normally() defined?
test_non_emulated_tools_execute_normally() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_tool_emulator.py at line 182.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free