fix: lint

This commit is contained in:
Mason Daugherty
2025-09-09 18:59:38 -04:00
parent 20979d525c
commit a48ace52ad

View File

@@ -2355,7 +2355,7 @@ def test_tool_injected_tool_call_id_override_llm_generated() -> None:
@tool
def foo(x: int, tool_call_id: Annotated[str, InjectedToolCallId]) -> ToolMessage:
"""Foo."""
return ToolMessage(x, tool_call_id=tool_call_id) # type: ignore[arg-type]
return ToolMessage(str(x), tool_call_id=tool_call_id)
# Test that when LLM generates the tool_call_id, it gets overridden
result = foo.invoke(
@@ -2368,14 +2368,14 @@ def test_tool_injected_tool_call_id_override_llm_generated() -> None:
)
# The tool should receive the real tool call ID, not the LLM-generated one
assert result == ToolMessage(0, tool_call_id="real_tool_call_id") # type: ignore[arg-type]
assert result == ToolMessage("0", tool_call_id="real_tool_call_id")
def test_tool_uninjected_tool_call_id() -> None:
@tool
def foo(x: int, tool_call_id: str) -> ToolMessage:
"""Foo."""
return ToolMessage(x, tool_call_id=tool_call_id) # type: ignore[call-overload]
return ToolMessage(str(x), tool_call_id=tool_call_id)
with pytest.raises(ValueError, match="1 validation error for foo"):
foo.invoke({"type": "tool_call", "args": {"x": 0}, "name": "foo", "id": "bar"})