Skip to content

Add support for Azure OpenAI Embedding Function #82

@kaijchen

Description

@kaijchen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions