ollama / ollama-js

Ollama JavaScript library
https://ollama.com
MIT License
2.27k stars 178 forks source link

Constructor "headers" option is ignored when using Custom Client. #161

Closed davloperez closed 1 week ago

davloperez commented 1 week ago

The headers field of the Ollama constructor function options (AKA Config in interfaces.ts) is completely ignored in this constructor code, and thus, it is not taken into account when performing fetch from other methods. It probably should be stored in this.config.headers.

This makes, for example, impossible to manually specify any Authorization custom header when performing our /api/generate loved requests :(

davloperez commented 1 week ago

Sorry, I didn't noticed that it has been fixed a couple days ago in https://github.com/ollama/ollama-js/pull/158

Waiting for the new version to have the fix. Thanks!

ParthSareen commented 1 week ago

Just cut a new release! Should be available now 😄