This commit is contained in:
JiangNan 2026-03-08 22:10:16 +08:00 committed by GitHub
commit f4ba19c55d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -801,7 +801,12 @@ class AsyncClient(BaseClient):
Returns:
WebSearchResponse with the search results
Raises:
ValueError: If OLLAMA_API_KEY environment variable is not set
"""
if not self._client.headers.get('authorization', '').startswith('Bearer '):
raise ValueError('Authorization header with Bearer token is required for web search')
return await self._request(
WebSearchResponse,
'POST',
@ -821,7 +826,12 @@ class AsyncClient(BaseClient):
Returns:
WebFetchResponse with the fetched result
Raises:
ValueError: If OLLAMA_API_KEY environment variable is not set
"""
if not self._client.headers.get('authorization', '').startswith('Bearer '):
raise ValueError('Authorization header with Bearer token is required for web fetch')
return await self._request(
WebFetchResponse,
'POST',