mirror of
https://github.com/ollama/ollama-python.git
synced 2026-10-10 19:07:33 +00:00
add content-type and accept
mirrors header values set by ollama cli
This commit is contained in:
+3
-1
@@ -47,7 +47,9 @@ class BaseClient:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
headers = kwargs.pop('headers', {})
|
headers = kwargs.pop('headers', {})
|
||||||
headers['user-agent'] = f'ollama-python/{__version__} ({platform.machine()} {platform.system().lower()}) Python/{platform.python_version()}'
|
headers['Content-Type'] = 'application/json'
|
||||||
|
headers['Accept'] = 'application/json'
|
||||||
|
headers['User-Agent'] = f'ollama-python/{__version__} ({platform.machine()} {platform.system().lower()}) Python/{platform.python_version()}'
|
||||||
|
|
||||||
self._client = client(
|
self._client = client(
|
||||||
base_url=_parse_host(host or os.getenv('OLLAMA_HOST')),
|
base_url=_parse_host(host or os.getenv('OLLAMA_HOST')),
|
||||||
|
|||||||
Reference in New Issue
Block a user