EmbeddingGeneratorBuilderServiceCollectionExtensions.AddKeyedEmbeddingGenerator<TInput,TEmbedding> 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 an embedding generator to the IServiceCollection.
public:
generic <typename TInput, typename TEmbedding>
where TEmbedding : Microsoft::Extensions::AI::Embedding[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddKeyedEmbeddingGenerator(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::Object ^ serviceKey, Func<Microsoft::Extensions::AI::EmbeddingGeneratorBuilder<TInput, TEmbedding> ^, Microsoft::Extensions::AI::IEmbeddingGenerator<TInput, TEmbedding> ^> ^ generatorFactory);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddKeyedEmbeddingGenerator<TInput,TEmbedding> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, object serviceKey, Func<Microsoft.Extensions.AI.EmbeddingGeneratorBuilder<TInput,TEmbedding>,Microsoft.Extensions.AI.IEmbeddingGenerator<TInput,TEmbedding>> generatorFactory) where TEmbedding : Microsoft.Extensions.AI.Embedding;
static member AddKeyedEmbeddingGenerator : Microsoft.Extensions.DependencyInjection.IServiceCollection * obj * Func<Microsoft.Extensions.AI.EmbeddingGeneratorBuilder<'Input, 'Embedding>, Microsoft.Extensions.AI.IEmbeddingGenerator<'Input, 'Embedding>> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Embedding :> Microsoft.Extensions.AI.Embedding)
<Extension()>
Public Function AddKeyedEmbeddingGenerator(Of TInput, TEmbedding) (services As IServiceCollection, serviceKey As Object, generatorFactory As Func(Of EmbeddingGeneratorBuilder(Of TInput, TEmbedding), IEmbeddingGenerator(Of TInput, TEmbedding))) As IServiceCollection
Type Parameters
- TInput
The type from which embeddings will be generated.
- TEmbedding
The type of embeddings to generate.
Parameters
- services
- IServiceCollection
The IServiceCollection to which the service should be added.
- serviceKey
- Object
The key with which to associated the generator.
- generatorFactory
- Func<EmbeddingGeneratorBuilder<TInput,TEmbedding>,IEmbeddingGenerator<TInput,TEmbedding>>
The factory to use to construct the IEmbeddingGenerator<TInput,TEmbedding> instance.
Returns
The services
collection.
Remarks
The generator is registered as a scoped service.
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET