client: point websearch to local ollama

This commit is contained in:
ParthSareen 2025-10-03 16:25:18 -07:00
parent 9ddd5f0182
commit f0edc1afa8
2 changed files with 6 additions and 6 deletions

View File

@ -652,7 +652,7 @@ class Client(BaseClient):
return self._request( return self._request(
WebSearchResponse, WebSearchResponse,
'POST', 'POST',
'https://ollama.com/api/web_search', '/api/web_search',
json=WebSearchRequest( json=WebSearchRequest(
query=query, query=query,
max_results=max_results, max_results=max_results,
@ -675,7 +675,7 @@ class Client(BaseClient):
return self._request( return self._request(
WebFetchResponse, WebFetchResponse,
'POST', 'POST',
'https://ollama.com/api/web_fetch', '/api/web_fetch',
json=WebFetchRequest( json=WebFetchRequest(
url=url, url=url,
).model_dump(exclude_none=True), ).model_dump(exclude_none=True),
@ -764,7 +764,7 @@ class AsyncClient(BaseClient):
return await self._request( return await self._request(
WebSearchResponse, WebSearchResponse,
'POST', 'POST',
'https://ollama.com/api/web_search', '/api/web_search',
json=WebSearchRequest( json=WebSearchRequest(
query=query, query=query,
max_results=max_results, max_results=max_results,
@ -784,7 +784,7 @@ class AsyncClient(BaseClient):
return await self._request( return await self._request(
WebFetchResponse, WebFetchResponse,
'POST', 'POST',
'https://ollama.com/api/web_fetch', '/api/web_fetch',
json=WebFetchRequest( json=WebFetchRequest(
url=url, url=url,
).model_dump(exclude_none=True), ).model_dump(exclude_none=True),

View File

@ -1217,14 +1217,14 @@ def test_client_web_fetch_requires_bearer_auth_header(monkeypatch: pytest.Monkey
def _mock_request_web_search(self, cls, method, url, json=None, **kwargs): def _mock_request_web_search(self, cls, method, url, json=None, **kwargs):
assert method == 'POST' assert method == 'POST'
assert url == 'https://ollama.com/api/web_search' assert url == '/api/web_search'
assert json is not None and 'query' in json and 'max_results' in json assert json is not None and 'query' in json and 'max_results' in json
return httpxResponse(status_code=200, content='{"results": {}, "success": true}') return httpxResponse(status_code=200, content='{"results": {}, "success": true}')
def _mock_request_web_fetch(self, cls, method, url, json=None, **kwargs): def _mock_request_web_fetch(self, cls, method, url, json=None, **kwargs):
assert method == 'POST' assert method == 'POST'
assert url == 'https://ollama.com/api/web_fetch' assert url == '/api/web_fetch'
assert json is not None and 'url' in json assert json is not None and 'url' in json
return httpxResponse(status_code=200, content='{"results": {}, "success": true}') return httpxResponse(status_code=200, content='{"results": {}, "success": true}')