Problem Description
The current OpenAIEmbeddingFunction in pymilvus.model wraps the standard openai.OpenAI client. This client is incompatible with Azure OpenAI Service, which requires the openai.AzureOpenAI client to handle specific headers and the api_version parameter.
Proposed Solution
Add a new class AzureOpenAIEmbeddingFunction that wraps openai.AzureOpenAI. This class should accept Azure-specific parameters (azure_endpoint, api_version) to correctly instantiate the Azure client.
Context
I have locally implemented and tested a wrapper using openai.AzureOpenAI and confirmed it works with Azure endpoints. I plan to submit a PR for this.
Problem Description
The current
OpenAIEmbeddingFunctioninpymilvus.modelwraps the standardopenai.OpenAIclient. This client is incompatible with Azure OpenAI Service, which requires theopenai.AzureOpenAIclient to handle specific headers and theapi_versionparameter.Proposed Solution
Add a new class
AzureOpenAIEmbeddingFunctionthat wrapsopenai.AzureOpenAI. This class should accept Azure-specific parameters (azure_endpoint,api_version) to correctly instantiate the Azure client.Context
I have locally implemented and tested a wrapper using
openai.AzureOpenAIand confirmed it works with Azure endpoints. I plan to submit a PR for this.