Skip to content

Commit ec8bf88

Browse files
committed
add content-type and accept
mirrors header values set by ollama cli
1 parent 8b929ab commit ec8bf88

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ollama/_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ def __init__(
4747
"""
4848

4949
headers = kwargs.pop('headers', {})
50-
headers['user-agent'] = f'ollama-python/{__version__} ({platform.machine()} {platform.system().lower()}) Python/{platform.python_version()}'
50+
headers['Content-Type'] = 'application/json'
51+
headers['Accept'] = 'application/json'
52+
headers['User-Agent'] = f'ollama-python/{__version__} ({platform.machine()} {platform.system().lower()}) Python/{platform.python_version()}'
5153

5254
self._client = client(
5355
base_url=_parse_host(host or os.getenv('OLLAMA_HOST')),

0 commit comments

Comments
 (0)