microsoft/semantic-kernel

.Net: The OpenAITextEmbeddingGenerationService constructor that takes an OpenAIClient does not allow to set embedding dimensions

Closed this issue · 0 comments

Describe the bug
The OpenAITextEmbeddingGenerationService.cs class contains two constructors, but only the first allows to set embedding dimensions:

public OpenAITextEmbeddingGenerationService(
string modelId,
string apiKey,
string? organization = null,
HttpClient? httpClient = null,
ILoggerFactory? loggerFactory = null,
int? dimensions = null)

public OpenAITextEmbeddingGenerationService(
string modelId,
OpenAIClient openAIClient,
ILoggerFactory? loggerFactory = null)

Expected behavior
The dimensions parameter should be available in both constructors..

Platform

  • Language: C#
  • Source: NuGet package version 1.11.0, main branch of repository