8 instantiations of EmbeddingGenerationOptions
Microsoft.Extensions.AI (1)
Embeddings\ConfigureOptionsEmbeddingGenerator.cs (1)
55options = options?.Clone() ?? new();
Microsoft.Extensions.AI.Abstractions (1)
Embeddings\EmbeddingGenerationOptions.cs (1)
41new()
Microsoft.Extensions.AI.Abstractions.Tests (4)
Embeddings\EmbeddingGenerationOptionsTests.cs (4)
15EmbeddingGenerationOptions options = new(); 29EmbeddingGenerationOptions options = new(); 37EmbeddingGenerationOptions options = new(); 61EmbeddingGenerationOptions options = new();
Microsoft.Extensions.AI.Tests (2)
Embeddings\ConfigureOptionsEmbeddingGeneratorTests.cs (1)
33EmbeddingGenerationOptions? providedOptions = nullProvidedOptions ? null : new() { ModelId = "test" };
Embeddings\UseDelegateEmbeddingGeneratorTests.cs (1)
36EmbeddingGenerationOptions expectedOptions = new();
65 references to EmbeddingGenerationOptions
Aspire.Azure.AI.OpenAI.Tests (1)
AspireAzureOpenAIClientBuilderEmbeddingGeneratorExtensionsTests.cs (1)
221private Task<GeneratedEmbeddings<Embedding<float>>> TestMiddleware(IEnumerable<string> inputs, EmbeddingGenerationOptions? options, IEmbeddingGenerator<string, Embedding<float>> nextAsync, CancellationToken cancellationToken)
Aspire.OpenAI.Tests (1)
AspireOpenAIClientBuilderEmbeddingGeneratorExtensionsTests.cs (1)
222private Task<GeneratedEmbeddings<Embedding<float>>> TestMiddleware(IEnumerable<string> inputs, EmbeddingGenerationOptions? options, IEmbeddingGenerator<string, Embedding<float>> nextAsync, CancellationToken cancellationToken)
Microsoft.Extensions.AI (27)
Embeddings\AnonymousDelegatingEmbeddingGenerator.cs (3)
19private readonly Func<IEnumerable<TInput>, EmbeddingGenerationOptions?, IEmbeddingGenerator<TInput, TEmbedding>, CancellationToken, Task<GeneratedEmbeddings<TEmbedding>>> _generateFunc; 28Func<IEnumerable<TInput>, EmbeddingGenerationOptions?, IEmbeddingGenerator<TInput, TEmbedding>, CancellationToken, Task<GeneratedEmbeddings<TEmbedding>>> generateFunc) 38IEnumerable<TInput> values, EmbeddingGenerationOptions? options = null, CancellationToken cancellationToken = default)
Embeddings\CachingEmbeddingGenerator.cs (1)
29IEnumerable<TInput> values, EmbeddingGenerationOptions? options = null, CancellationToken cancellationToken = default)
Embeddings\ConfigureOptionsEmbeddingGenerator.cs (12)
12/// <summary>Represents a delegating embedding generator that configures a <see cref="EmbeddingGenerationOptions"/> instance used by the remainder of the pipeline.</summary> 19private readonly Action<EmbeddingGenerationOptions> _configureOptions; 27/// The delegate to invoke to configure the <see cref="EmbeddingGenerationOptions"/> instance. It is passed a clone of the caller-supplied 28/// <see cref="EmbeddingGenerationOptions"/> instance (or a newly constructed instance if the caller-supplied instance is <see langword="null"/>). 31/// The <paramref name="configure"/> delegate is passed either a new instance of <see cref="EmbeddingGenerationOptions"/> if 32/// the caller didn't supply a <see cref="EmbeddingGenerationOptions"/> instance, or a clone (via <see cref="EmbeddingGenerationOptions.Clone"/> of the caller-supplied 37Action<EmbeddingGenerationOptions> configure) 46EmbeddingGenerationOptions? options = null, 52/// <summary>Creates and configures the <see cref="EmbeddingGenerationOptions"/> to pass along to the inner client.</summary> 53private EmbeddingGenerationOptions Configure(EmbeddingGenerationOptions? options)
Embeddings\ConfigureOptionsEmbeddingGeneratorBuilderExtensions.cs (7)
15/// Adds a callback that configures a <see cref="EmbeddingGenerationOptions"/> to be passed to the next client in the pipeline. 21/// The delegate to invoke to configure the <see cref="EmbeddingGenerationOptions"/> instance. It is passed a clone of the caller-supplied 22/// <see cref="EmbeddingGenerationOptions"/> instance (or a new constructed instance if the caller-supplied instance is <see langword="null"/>). 26/// <see cref="EmbeddingGenerationOptions"/> if the caller didn't supply a <see cref="EmbeddingGenerationOptions"/> instance, or 27/// a clone (via <see cref="EmbeddingGenerationOptions.Clone"/> 33Action<EmbeddingGenerationOptions> configure)
Embeddings\EmbeddingGeneratorBuilder.cs (1)
99Func<IEnumerable<TInput>, EmbeddingGenerationOptions?, IEmbeddingGenerator<TInput, TEmbedding>, CancellationToken, Task<GeneratedEmbeddings<TEmbedding>>>? generateFunc)
Embeddings\LoggingEmbeddingGenerator.cs (1)
49public override async Task<GeneratedEmbeddings<TEmbedding>> GenerateAsync(IEnumerable<TInput> values, EmbeddingGenerationOptions? options = null, CancellationToken cancellationToken = default)
Embeddings\OpenTelemetryEmbeddingGenerator.cs (2)
81public override async Task<GeneratedEmbeddings<TEmbedding>> GenerateAsync(IEnumerable<TInput> values, EmbeddingGenerationOptions? options = null, CancellationToken cancellationToken = default) 121private Activity? CreateAndConfigureActivity(EmbeddingGenerationOptions? options)
Microsoft.Extensions.AI.Abstractions (9)
Embeddings\DelegatingEmbeddingGenerator.cs (1)
58public virtual Task<GeneratedEmbeddings<TEmbedding>> GenerateAsync(IEnumerable<TInput> values, EmbeddingGenerationOptions? options = null, CancellationToken cancellationToken = default) =>
Embeddings\EmbeddingGenerationOptions.cs (3)
34/// <summary>Produces a clone of the current <see cref="EmbeddingGenerationOptions"/> instance.</summary> 35/// <returns>A clone of the current <see cref="EmbeddingGenerationOptions"/> instance.</returns> 40public virtual EmbeddingGenerationOptions Clone() =>
Embeddings\EmbeddingGeneratorExtensions.cs (3)
70EmbeddingGenerationOptions? options = null, 95EmbeddingGenerationOptions? options = null, 131EmbeddingGenerationOptions? options = null,
Embeddings\IEmbeddingGenerator.cs (1)
37EmbeddingGenerationOptions? options = null,
Utilities\AIJsonUtilities.Defaults.cs (1)
55[JsonSerializable(typeof(EmbeddingGenerationOptions))]
Microsoft.Extensions.AI.Abstractions.Tests (10)
Embeddings\EmbeddingGenerationOptionsTests.cs (7)
15EmbeddingGenerationOptions options = new(); 20EmbeddingGenerationOptions clone = options.Clone(); 29EmbeddingGenerationOptions options = new(); 37EmbeddingGenerationOptions options = new(); 52EmbeddingGenerationOptions clone = options.Clone(); 61EmbeddingGenerationOptions options = new(); 74EmbeddingGenerationOptions? deserialized = JsonSerializer.Deserialize(json, TestJsonSerializerContext.Default.EmbeddingGenerationOptions);
TestEmbeddingGenerator.cs (2)
15public Func<IEnumerable<string>, EmbeddingGenerationOptions?, CancellationToken, Task<GeneratedEmbeddings<Embedding<float>>>>? GenerateAsyncCallback { get; set; } 19public Task<GeneratedEmbeddings<Embedding<float>>> GenerateAsync(IEnumerable<string> values, EmbeddingGenerationOptions? options = null, CancellationToken cancellationToken = default)
TestJsonSerializerContext.cs (1)
20[JsonSerializable(typeof(EmbeddingGenerationOptions))]
Microsoft.Extensions.AI.AzureAIInference (4)
AzureAIInferenceEmbeddingGenerator.cs (4)
37/// The ID of the model to use. This can also be overridden per request via <see cref="EmbeddingGenerationOptions.ModelId"/>. 38/// Either this parameter or <see cref="EmbeddingGenerationOptions.ModelId"/> must provide a valid model ID. 86IEnumerable<string> values, EmbeddingGenerationOptions? options = null, CancellationToken cancellationToken = default) 161private EmbeddingsOptions ToAzureAIOptions(IEnumerable<string> inputs, EmbeddingGenerationOptions? options, EmbeddingEncodingFormat format)
Microsoft.Extensions.AI.Integration.Tests (3)
CallCountingEmbeddingGenerator.cs (1)
21IEnumerable<string> values, EmbeddingGenerationOptions? options = null, CancellationToken cancellationToken = default)
QuantizationEmbeddingGenerator.cs (2)
37IEnumerable<string> values, EmbeddingGenerationOptions? options, CancellationToken cancellationToken) 70IEnumerable<string> values, EmbeddingGenerationOptions? options, CancellationToken cancellationToken)
Microsoft.Extensions.AI.Ollama (1)
OllamaEmbeddingGenerator.cs (1)
80IEnumerable<string> values, EmbeddingGenerationOptions? options = null, CancellationToken cancellationToken = default)
Microsoft.Extensions.AI.OpenAI (2)
OpenAIEmbeddingGenerator.cs (2)
112public async Task<GeneratedEmbeddings<Embedding<float>>> GenerateAsync(IEnumerable<string> values, EmbeddingGenerationOptions? options = null, CancellationToken cancellationToken = default) 140private OpenAI.Embeddings.EmbeddingGenerationOptions? ToOpenAIOptions(EmbeddingGenerationOptions? options)
Microsoft.Extensions.AI.Tests (7)
Embeddings\ConfigureOptionsEmbeddingGeneratorTests.cs (2)
33EmbeddingGenerationOptions? providedOptions = nullProvidedOptions ? null : new() { ModelId = "test" }; 34EmbeddingGenerationOptions? returnedOptions = null;
Embeddings\UseDelegateEmbeddingGeneratorTests.cs (2)
21builder.Use((Func<IEnumerable<string>, EmbeddingGenerationOptions?, IEmbeddingGenerator<string, Embedding<float>>, CancellationToken, Task<GeneratedEmbeddings<Embedding<float>>>>)null!)); 36EmbeddingGenerationOptions expectedOptions = new();
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\TestEmbeddingGenerator.cs (2)
15public Func<IEnumerable<string>, EmbeddingGenerationOptions?, CancellationToken, Task<GeneratedEmbeddings<Embedding<float>>>>? GenerateAsyncCallback { get; set; } 19public Task<GeneratedEmbeddings<Embedding<float>>> GenerateAsync(IEnumerable<string> values, EmbeddingGenerationOptions? options = null, CancellationToken cancellationToken = default)
TestJsonSerializerContext.cs (1)
29[JsonSerializable(typeof(EmbeddingGenerationOptions))]