mirror of
https://github.com/ollama/ollama-python.git
synced 2026-05-01 11:48:17 +08:00
Merge 7a36db4abb into dbccf192ac
This commit is contained in:
commit
f4ba19c55d
@ -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',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user