You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems there is no way to pass custom http headers to a (Chat)Ollama llm. This can be useful in certain cases, and it is possible on the python implementation.
It could be an additional argument passed in the llm instance construction containing the extra headers that should be added to the requests
The text was updated successfully, but these errors were encountered:
In the langchainjs framework, you can pass custom HTTP headers to a (Chat)Ollama llm by providing a headers object in the APIChainInput when creating a new APIChain instance. This headers object should be a record of string keys and values, representing the header names and their corresponding values.
Here is an example of how you can do this:
constheaders={'Custom-Header-1': 'Value1','Custom-Header-2': 'Value2',// Add more headers as needed};constapiChain=newAPIChain({apiAnswerChain: answerChain,apiRequestChain: requestChain,apiDocs: 'Your API documentation',headers: headers,// Pass the headers here});
In the above code, replace answerChain and requestChain with your actual LLMChain instances, and replace 'Your API documentation' with your actual API documentation.
This is supported by the APIChain class in the provided context, which accepts an APIChainInput object in its constructor. The APIChainInput interface includes an optional headers field of type Record<string, string>. This headers object is then used in the _call method of the APIChain class when making the fetch request.
It seems there is no way to pass custom http headers to a (Chat)Ollama llm. This can be useful in certain cases, and it is possible on the python implementation.
It could be an additional argument passed in the llm instance construction containing the extra headers that should be added to the requests
The text was updated successfully, but these errors were encountered: