fix(tools): validate arguments with jsonschema without coercion (#6648)

Co-authored-by: xiong-wei1 <2318942410@qq.com>
This commit is contained in:
chengyongruandxiong-wei1 authored and GitHub committed 2026-11-13 13:32:12 +08:00
1 parent 25ed91ffeb
commit 8cce73465b
27 files changed
+689 -614

No files matched your search

+3 -2
View File
@@ -71,7 +71,8 @@ def test_search_concurrency_without_api_key(
@pytest.mark.asyncio
async def test_brave_search(monkeypatch):
@pytest.mark.parametrize("count", [1, 1.0])
async def test_brave_search(monkeypatch, count):
async def mock_get(self, url, **kw):
assert "brave" in url
assert kw["headers"]["X-Subscription-Token"] == "brave-key"
@@ -82,7 +83,7 @@ async def test_brave_search(monkeypatch):
monkeypatch.setattr(httpx.AsyncClient, "get", mock_get)
tool = _tool(provider="brave", api_key="brave-key", user_agent="nanobot-search-test")
result = await tool.execute(query="nanobot", count=1)
result = await tool.execute(query="nanobot", count=count)
assert "NanoBot" in result
assert "https://example.com" in result