mirror of
https://github.com/ollama/ollama-python.git
synced 2026-05-03 12:52:35 +00:00
Merge 7a36db4abb into dbccf192ac
This commit is contained in:
@@ -801,7 +801,12 @@ class AsyncClient(BaseClient):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
WebSearchResponse with the search results
|
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(
|
return await self._request(
|
||||||
WebSearchResponse,
|
WebSearchResponse,
|
||||||
'POST',
|
'POST',
|
||||||
@@ -821,7 +826,12 @@ class AsyncClient(BaseClient):
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
WebFetchResponse with the fetched result
|
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(
|
return await self._request(
|
||||||
WebFetchResponse,
|
WebFetchResponse,
|
||||||
'POST',
|
'POST',
|
||||||
|
|||||||
Reference in New Issue
Block a user