OpenAIMemoryBuilderExtensions.WithOpenAITextEmbeddingGeneration Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds the OpenAI text embeddings service. See https://platform.openai.com/docs for service details.
public static Microsoft.SemanticKernel.Memory.MemoryBuilder WithOpenAITextEmbeddingGeneration (this Microsoft.SemanticKernel.Memory.MemoryBuilder builder, string modelId, string apiKey, string? orgId = default, System.Net.Http.HttpClient? httpClient = default, int? dimensions = default);
static member WithOpenAITextEmbeddingGeneration : Microsoft.SemanticKernel.Memory.MemoryBuilder * string * string * string * System.Net.Http.HttpClient * Nullable<int> -> Microsoft.SemanticKernel.Memory.MemoryBuilder
<Extension()>
Public Function WithOpenAITextEmbeddingGeneration (builder As MemoryBuilder, modelId As String, apiKey As String, Optional orgId As String = Nothing, Optional httpClient As HttpClient = Nothing, Optional dimensions As Nullable(Of Integer) = Nothing) As MemoryBuilder
Parameters
- builder
- MemoryBuilder
The MemoryBuilder instance
- modelId
- String
OpenAI model name, see https://platform.openai.com/docs/models
- apiKey
- String
OpenAI API key, see https://platform.openai.com/account/api-keys
- orgId
- String
OpenAI organization id. This is usually optional unless your account belongs to multiple organizations.
- httpClient
- HttpClient
Custom HttpClient for HTTP requests.
The number of dimensions the resulting output embeddings should have. Only supported in "text-embedding-3" and later models.
Returns
Self instance