Skip to content

Commit a48ace5

Browse files
committed
fix: lint
1 parent 20979d5 commit a48ace5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libs/core/tests/unit_tests/test_tools.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2355,7 +2355,7 @@ def test_tool_injected_tool_call_id_override_llm_generated() -> None:
23552355
@tool
23562356
def foo(x: int, tool_call_id: Annotated[str, InjectedToolCallId]) -> ToolMessage:
23572357
"""Foo."""
2358-
return ToolMessage(x, tool_call_id=tool_call_id) # type: ignore[arg-type]
2358+
return ToolMessage(str(x), tool_call_id=tool_call_id)
23592359

23602360
# Test that when LLM generates the tool_call_id, it gets overridden
23612361
result = foo.invoke(
@@ -2368,14 +2368,14 @@ def foo(x: int, tool_call_id: Annotated[str, InjectedToolCallId]) -> ToolMessage
23682368
)
23692369

23702370
# The tool should receive the real tool call ID, not the LLM-generated one
2371-
assert result == ToolMessage(0, tool_call_id="real_tool_call_id") # type: ignore[arg-type]
2371+
assert result == ToolMessage("0", tool_call_id="real_tool_call_id")
23722372

23732373

23742374
def test_tool_uninjected_tool_call_id() -> None:
23752375
@tool
23762376
def foo(x: int, tool_call_id: str) -> ToolMessage:
23772377
"""Foo."""
2378-
return ToolMessage(x, tool_call_id=tool_call_id) # type: ignore[call-overload]
2378+
return ToolMessage(str(x), tool_call_id=tool_call_id)
23792379

23802380
with pytest.raises(ValueError, match="1 validation error for foo"):
23812381
foo.invoke({"type": "tool_call", "args": {"x": 0}, "name": "foo", "id": "bar"})

0 commit comments

Comments
 (0)