SemanticKernel WebAPI proper DI
Have you ever worked with SemanticKernel in combination with WebAPI? Didn't found on github or ms docs examples there is only console applications like example.
Do you have any example or github code how to proper use SemnaticKernel in DI?
2 Replies
My guess is that you can use this extension https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/SemanticKernel.Abstractions/Services/KernelServiceCollectionExtensions.cs#L18 to add to an existing service collection
GitHub
semantic-kernel/dotnet/src/SemanticKernel.Abstractions/Services/Ker...
Integrate cutting-edge LLM technology quickly and easily into your apps - microsoft/semantic-kernel
ah, https://github.com/microsoft/semantic-kernel/issues/4482 probably has what you're looking for (and shows some examples in responses)
GitHub
.Net: Better document how to use existing registered dependencies w...
Right now Kernel use separate instance of service provider. That make it hard to consume already registered dependencies. It would be nice to have way to use existing service provider. Something li...