When using the OpenAIEmbeddings class, the configuration.defaultHeaders does not get passed with the api request. Is this intentional?
This sounds like a bug rather than intentional behavior. The OpenAIEmbeddings
class should respect the defaultHeaders
configuration like other OpenAI integrations in LangChain. You can work around this by either passing headers directly in the constructor if supported, or by creating a custom embedding class that extends OpenAIEmbeddings
and overrides the request method to include your headers. Consider filing a GitHub issue with LangChain since this appears to be inconsistent behavior compared to other OpenAI components.
Turns out I was mistaken, this was a bug in the litellm proxy we were using, the headers were getting lost there. Thanks for the input!