



An embedding function that utilizes the OpenAI API to compute vector embeddings, commonly used with vector databases.
An embedding function that utilizes the OpenAI API to compute vector embeddings, commonly used with vector databases. This class, part of pymilvus, handles encoding text into embeddings using OpenAI models to support embedding retrieval in Milvus.
The OpenAIEmbeddingFunction offers flexible configuration for integrating with OpenAI's embedding services:
text-embedding-3-small, text-embedding-3-large, and text-embedding-ada-002 (default).text-embedding-3 and later models.To initialize OpenAIEmbeddingFunction, the following parameters are available:
model_name (string): Specifies the OpenAI model for encoding. Valid options are text-embedding-3-small, text-embedding-3-large, and text-embedding-ada-002 (default).api_key (string, optional): Your OpenAI API key. If unspecified, environment variables are checked.base_url (string, optional): The base URL of the OpenAI API endpoint. Defaults to None (public OpenAI API server).dimensions (int, optional): The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.**kwargs: Allows additional keyword arguments to be passed to the model initialization.Loading more......