OpenAIEmbeddingFunction
An embedding function that utilizes the OpenAI API to compute vector embeddings, commonly used with vector databases.
About this tool
OpenAIEmbeddingFunction
Description
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.
Features
The OpenAIEmbeddingFunction offers flexible configuration for integrating with OpenAI's embedding services:
- Model Selection: Choose from various OpenAI models for encoding, including
text-embedding-3-small,text-embedding-3-large, andtext-embedding-ada-002(default). - API Key Management: Securely provide your OpenAI API key; the function also checks environment variables as a fallback.
- Custom Endpoint Support: Configure a custom base URL for the OpenAI API endpoint, defaulting to the public OpenAI API server.
- Embedding Dimensions Control: Specify the desired number of dimensions for the output embeddings, a feature supported by
text-embedding-3and later models. - Extensible Configuration: Allows passing additional keyword arguments directly to the underlying OpenAI model initialization for advanced use cases.
Constructor Parameters
To initialize OpenAIEmbeddingFunction, the following parameters are available:
model_name(string): Specifies the OpenAI model for encoding. Valid options aretext-embedding-3-small,text-embedding-3-large, andtext-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 toNone(public OpenAI API server).dimensions(int, optional): The number of dimensions the resulting output embeddings should have. Only supported intext-embedding-3and later models.**kwargs: Allows additional keyword arguments to be passed to the model initialization.
Loading more......
Information
Categories
Tags
Similar Products
6 result(s)A wrapper embedding function for Jina Embedding models, used to generate vector embeddings.
A server that provides text embeddings, serving as a backend for embedding functions used with vector databases.
A collection of examples and guides from OpenAI, including best practices for working with embeddings, which are fundamental to vector search and vector database applications.
A pre-trained model used for extracting embeddings from content like PDFs, videos, and transcripts, which are then stored in vector databases for faster search.
A Python library for creating sentence, text, and image embeddings, enabling the conversion of text into high-dimensional numerical vectors that capture semantic meaning. It is essential for tasks like semantic search and Retrieval Augmented Generation (RAG), which often leverage vector databases.
A Python library for generating high-quality sentence, text, and image embeddings. It simplifies the process of converting text into dense vector representations, which are fundamental for similarity search and storage in vector databases.