OpenAIEmbeddingModel<T>

Models & Types ยท AiDotNet.RetrievalAugmentedGeneration.EmbeddingModels

OpenAI embedding model for generating embeddings via OpenAI API.

Inheritance: EmbeddingModelBase<T> โ†’ OpenAIEmbeddingModel<T>

Constructors

Constructor Summary
OpenAIEmbeddingModel(string apiKey, string modelName, int dimension, int maxTokens, HttpClient httpClient) Initializes a new instance of the OpenAIEmbeddingModel class.

Properties

Property Summary
int EmbeddingDimension { get; }
int MaxTokens { get; }

Methods

Method Summary
Task<Matrix<T>> EmbedBatchAsync(IEnumerable<string> texts) Asynchronously encodes a batch of texts into vector representations via the OpenAI API.
Task<Vector<T>> EmbedAsync(string text) Asynchronously encodes a single text into a vector representation via the OpenAI API.