1 interface inheriting from IEmbeddingGenerator
Microsoft.Extensions.AI.Abstractions (1)
Embeddings\IEmbeddingGenerator{TInput,TEmbedding}.cs (1)
28public interface IEmbeddingGenerator<in TInput, TEmbedding> : IEmbeddingGenerator
65 references to IEmbeddingGenerator
Aspire.Azure.AI.Inference.Tests (3)
AspireAzureAIInferenceEmbeddingsExtensionTests.cs (3)
132var client = useKeyed ? 133host.Services.GetKeyedService<IEmbeddingGenerator>("embedding") : 134host.Services.GetService<IEmbeddingGenerator>();
Microsoft.Extensions.AI (2)
Embeddings\EmbeddingGeneratorBuilderServiceCollectionExtensions.cs (2)
56serviceCollection.Add(new ServiceDescriptor(typeof(IEmbeddingGenerator), 108serviceCollection.Add(new ServiceDescriptor(typeof(IEmbeddingGenerator), serviceKey,
Microsoft.Extensions.AI.Abstractions (7)
Embeddings\EmbeddingGenerationOptions.cs (4)
57/// The underlying <see cref="IEmbeddingGenerator" /> implementation may have its own representation of options. 61/// which concrete <see cref="IEmbeddingGenerator" /> is being used and how it represents options, a new instance of that 62/// implementation-specific options type may be returned by this callback, for the <see cref="IEmbeddingGenerator" /> 70public Func<IEmbeddingGenerator, object?>? RawRepresentationFactory { get; set; }
Embeddings\EmbeddingGeneratorExtensions.cs (3)
27this IEmbeddingGenerator generator, object? serviceKey = null) 50this IEmbeddingGenerator generator, Type serviceType, object? serviceKey = null) 75this IEmbeddingGenerator generator, object? serviceKey = null)
Microsoft.Extensions.AI.Abstractions.Tests (1)
Embeddings\EmbeddingGenerationOptionsTests.cs (1)
44Func<IEmbeddingGenerator?, object?> rawRepresentationFactory = (c) => null;
Microsoft.Extensions.AI.OpenAI (1)
OpenAIEmbeddingGenerator.cs (1)
103object? IEmbeddingGenerator.GetService(Type serviceType, object? serviceKey)
Microsoft.Extensions.AI.Tests (4)
ChatCompletion\DependencyInjectionPatterns.cs (4)
195IEmbeddingGenerator? ng = sp.GetService<IEmbeddingGenerator>(); 241IEmbeddingGenerator? ng = sp.GetKeyedService<IEmbeddingGenerator>("key");
Microsoft.Extensions.VectorData.Abstractions (40)
IKeywordHybridSearchable.cs (9)
34/// A <see cref="string"/> or <see cref="DataContent"/> (for images, sound...) if an appropriate <see cref="IEmbeddingGenerator"/> has been configured that accepts that type as input. 35/// For example, register an <see cref="IEmbeddingGenerator"/> that accepts <see cref="string"/> as input in your dependency injection container, and then pass in a 36/// <see cref="string"/> argument to this method; the argument will be automatically passed to the <see cref="IEmbeddingGenerator"/> to generate the embedding and perform the search. 38/// <see cref="IEmbeddingGenerator"/> with Microsoft.Extensions.VectorData. The provider will simply send your argument to the database as-is for embedding generation. 41/// Arbitrary .NET types can also be passed in as long as an appropriate <see cref="IEmbeddingGenerator"/> has been configured; for example, you can create your own <see cref="IEmbeddingGenerator"/> 42/// that accepts your own custom types as input, and uses another <see cref="IEmbeddingGenerator"/> to generate embedding from multiple properties. For .NET types beyond <see cref="string"/> and 51/// If you're using <see cref="IEmbeddingGenerator"/> directly in your code, that type returns an <see cref="Embedding"/> (for example, <c>Embedding{float}</c>), 52/// which can also be passed in directly, as long as the provider supports the specific embedding type. However, consider registering your <see cref="IEmbeddingGenerator"/> with the provider
IVectorSearchable.cs (9)
33/// A <see cref="string"/> or <see cref="DataContent"/> (for images, sound...) if an appropriate <see cref="IEmbeddingGenerator"/> has been configured that accepts that type as input. 34/// For example, register an <see cref="IEmbeddingGenerator"/> that accepts <see cref="string"/> as input in your dependency injection container, and then pass in a 35/// <see cref="string"/> argument to this method; the argument will be automatically passed to the <see cref="IEmbeddingGenerator"/> to generate the embedding and perform the search. 37/// <see cref="IEmbeddingGenerator"/> with Microsoft.Extensions.VectorData. The provider will simply send your argument to the database as-is for embedding generation. 40/// Arbitrary .NET types can also be passed in as long as an appropriate <see cref="IEmbeddingGenerator"/> has been configured; for example, you can create your own <see cref="IEmbeddingGenerator"/> 41/// that accepts your own custom types as input, and uses another <see cref="IEmbeddingGenerator"/> to generate embedding from multiple properties. For .NET types beyond <see cref="string"/> and 50/// If you're using <see cref="IEmbeddingGenerator"/> directly in your code, that type returns an <see cref="Embedding"/> (for example, <c>Embedding{float}</c>), 51/// which can also be passed in directly, as long as the provider supports the specific embedding type. However, consider registering your <see cref="IEmbeddingGenerator"/> with the provider
ProviderServices\CollectionJsonModelBuilder.cs (2)
41IEmbeddingGenerator? defaultEmbeddingGenerator, 55IEmbeddingGenerator? defaultEmbeddingGenerator,
ProviderServices\CollectionModelBuilder.cs (6)
59protected IEmbeddingGenerator? DefaultEmbeddingGenerator { get; private set; } 85public virtual CollectionModel Build(Type recordType, Type keyType, VectorStoreCollectionDefinition? definition, IEmbeddingGenerator? defaultEmbeddingGenerator) 155public virtual CollectionModel BuildDynamic(VectorStoreCollectionDefinition definition, IEmbeddingGenerator? defaultEmbeddingGenerator) 383IEmbeddingGenerator embeddingGenerator, 402private EmbeddingGenerationDispatcher? ResolveSearchOnlyEmbeddingHandler(VectorPropertyModel vectorProperty, IEmbeddingGenerator embeddingGenerator) 428IEmbeddingGenerator? embeddingGenerator,
ProviderServices\EmbeddingGenerationDispatcher.cs (2)
43public abstract Type? ResolveEmbeddingType(VectorPropertyModel vectorProperty, IEmbeddingGenerator embeddingGenerator, Type? userRequestedEmbeddingType); 64public abstract bool CanGenerateEmbedding(VectorPropertyModel vectorProperty, IEmbeddingGenerator embeddingGenerator);
ProviderServices\EmbeddingGenerationDispatcher{TEmbedding}.cs (2)
27public override Type? ResolveEmbeddingType(VectorPropertyModel vectorProperty, IEmbeddingGenerator embeddingGenerator, Type? userRequestedEmbeddingType) 31public override bool CanGenerateEmbedding(VectorPropertyModel vectorProperty, IEmbeddingGenerator embeddingGenerator)
ProviderServices\VectorDataStrings.cs (1)
43public static string IncompatibleEmbeddingGenerator(VectorPropertyModel vectorProperty, IEmbeddingGenerator embeddingGenerator, string supportedOutputTypes)
ProviderServices\VectorPropertyModel.cs (3)
78public IEmbeddingGenerator? EmbeddingGenerator { get; set; } 99public virtual bool CanGenerateEmbedding<TEmbedding>(IEmbeddingGenerator embeddingGenerator) 111public virtual Type? ResolveEmbeddingType<TEmbedding>(IEmbeddingGenerator embeddingGenerator, Type? userRequestedEmbeddingType)
ProviderServices\VectorPropertyModel{TInput}.cs (2)
21public override bool CanGenerateEmbedding<TEmbedding>(IEmbeddingGenerator embeddingGenerator) 26public override Type? ResolveEmbeddingType<TEmbedding>(IEmbeddingGenerator embeddingGenerator, Type? userRequestedEmbeddingType)
RecordDefinition\VectorStoreCollectionDefinition.cs (1)
31public IEmbeddingGenerator? EmbeddingGenerator { get; set; }
RecordDefinition\VectorStoreVectorProperty.cs (1)
51public IEmbeddingGenerator? EmbeddingGenerator { get; set; }
RecordDefinition\VectorStoreVectorProperty{TInput}.cs (1)
20/// This generic version of <see cref="VectorStoreVectorProperty"/> only needs to be used when an <see cref="IEmbeddingGenerator"/> is
VectorStoreCollectionOptions.cs (1)
40public IEmbeddingGenerator? EmbeddingGenerator { get; set; }
Microsoft.Extensions.VectorData.ConformanceTests (7)
DependencyInjectionTests.cs (1)
166services.AddSingleton<IEmbeddingGenerator>(sp =>
EmbeddingGenerationTests.cs (4)
73serviceCollection.AddSingleton<IEmbeddingGenerator>(new FakeEmbeddingGenerator(replaceLast: 1)); 94serviceCollection.AddSingleton<IEmbeddingGenerator>(new FakeEmbeddingGenerator(replaceLast: 1)); 499public abstract VectorStore CreateVectorStore(IEmbeddingGenerator? embeddingGenerator = null); 570public abstract VectorStore CreateVectorStore(IEmbeddingGenerator? embeddingGenerator = null);
TypeTests\EmbeddingTypeTests.cs (2)
43IEmbeddingGenerator? embeddingGenerator = null, 228public virtual VectorStoreCollectionDefinition CreateRecordDefinition<TVectorProperty>(IEmbeddingGenerator? embeddingGenerator, string? distanceFunction, int dimensions)