in src/WebJobs.Extensions.OpenAI.AzureAISearch/AzureAISearchProvider.cs [50:72]
public AzureAISearchProvider(IConfiguration configuration, ILoggerFactory loggerFactory, IOptions<AzureAISearchConfigOptions> azureAiSearchConfigOptions, AzureComponentFactory azureComponentFactory)
{
this.configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
this.azureComponentFactory = azureComponentFactory ?? throw new ArgumentNullException(nameof(azureComponentFactory));
if (loggerFactory == null)
{
throw new ArgumentNullException(nameof(loggerFactory));
}
this.isSemanticSearchEnabled = azureAiSearchConfigOptions.Value.IsSemanticSearchEnabled;
this.useSemanticCaptions = azureAiSearchConfigOptions.Value.UseSemanticCaptions;
this.searchAPIKeySetting = azureAiSearchConfigOptions.Value.SearchAPIKeySetting ?? this.searchAPIKeySetting;
int value = azureAiSearchConfigOptions.Value.VectorSearchDimensions;
if (value < 2 || value > 3072)
{
throw new ArgumentOutOfRangeException(nameof(AzureAISearchConfigOptions.VectorSearchDimensions), value, "Vector search dimensions must be between 2 and 3072");
}
this.vectorSearchDimensions = value;
this.logger = loggerFactory.CreateLogger<AzureAISearchProvider>();
}