test_tool_retry_async_working_tool() — langchain Function Reference
Architecture documentation for the test_tool_retry_async_working_tool() function in test_tool_retry.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD ba196d72_2da4_8b34_fcba_9587f97bba52["test_tool_retry_async_working_tool()"] c71b26df_821f_59ac_c7ef_3b96fcbe0d5b["test_tool_retry.py"] ba196d72_2da4_8b34_fcba_9587f97bba52 -->|defined in| c71b26df_821f_59ac_c7ef_3b96fcbe0d5b style ba196d72_2da4_8b34_fcba_9587f97bba52 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_tool_retry.py lines 688–713
async def test_tool_retry_async_working_tool() -> None:
"""Test ToolRetryMiddlewarewith async execution and working tool."""
model = FakeToolCallingModel(
tool_calls=[
[ToolCall(name="working_tool", args={"value": "test"}, id="1")],
[],
]
)
retry = ToolRetryMiddleware(max_retries=2, initial_delay=0.01, jitter=False)
agent = create_agent(
model=model,
tools=[working_tool],
middleware=[retry],
checkpointer=InMemorySaver(),
)
result = await agent.ainvoke(
{"messages": [HumanMessage("Use working tool")]},
{"configurable": {"thread_id": "test"}},
)
tool_messages = [m for m in result["messages"] if isinstance(m, ToolMessage)]
assert len(tool_messages) == 1
assert "Success: test" in tool_messages[0].content
Domain
Subdomains
Source
Frequently Asked Questions
What does test_tool_retry_async_working_tool() do?
test_tool_retry_async_working_tool() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_tool_retry.py.
Where is test_tool_retry_async_working_tool() defined?
test_tool_retry_async_working_tool() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_tool_retry.py at line 688.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free