mirror of
https://github.com/ollama/ollama-python.git
synced 2026-05-01 11:48:17 +08:00
add content-type and accept
mirrors header values set by ollama cli
This commit is contained in:
parent
8b929ab496
commit
ec8bf88c2b
@ -47,7 +47,9 @@ class BaseClient:
|
||||
"""
|
||||
|
||||
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(
|
||||
base_url=_parse_host(host or os.getenv('OLLAMA_HOST')),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user