ASP.Net Core SemanticTextMemory - How to use plugin #8074
-
I have registered the Memory store / Plugin as below in ASP.Net core application I looked at the below sample where with Kernel.Invoke kernel functions are being used. builder.Services.AddTransient((serviceProvider) => {
Kernel kernel = new Kernel(serviceProvider);
IDatabase database = connectionMultiplexer.GetDatabase();
// If unspecified, the default vector size is 1536.
int vectorSize = 1536;
// Initialize a memory store using the redis database
IMemoryStore memoryStore = new RedisMemoryStore(database, vectorSize);
ITextEmbeddingGenerationService embeddingService = kernel.GetRequiredService<ITextEmbeddingGenerationService>();
// Initialize a SemanticTextMemory using the memory store and embedding generation service.
SemanticTextMemory textMemory = new(memoryStore, embeddingService);
// Initialize a TextMemoryPlugin using the text memory.
TextMemoryPlugin memoryPlugin = new TextMemoryPlugin(textMemory);
kernel.Plugins.AddFromObject(memoryPlugin,"memory");
return kernel;
}); I have couple of questions.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Beta Was this translation helpful? Give feedback.
Hi @hemantkathuria