How to use SK in Microsoft.Extensions.AI ? #9421
-
Could you please explain how Microsoft.Extensions.AI and SemanticKernel work together? When exactly we use Semantic Kernel inside Microsoft Extensions Library? The way abstraction is laid out, Microsoft Extensions.AI library uses all the LLM model directly with its own client connector with Tool Support. I am not able to visualize the usage of semantic kernel inside Microsoft Extension AI library. Please help me to understand. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
https://devblogs.microsoft.com/semantic-kernel/microsoft-extensions-ai-simplifying-ai-integration-for-net-partners/ this blog has a good overview and has some samples at the bottom as well. |
Beta Was this translation helpful? Give feedback.
-
Hi, i already read that article and it doesnt have answer for my question. Also, the samples dont have any SK integration. |
Beta Was this translation helpful? Give feedback.
-
With #9183, which should merge in the near future, you can see how they will start to work together. That PR adds bidirectional conversions between the corresponding interfaces, such that you can use any SK IChatCompletionService as an M.E.AI IChatClient, and vice versa, and similarly for embedding generation. The next step in the integration will be refactoring the SK connectors to simply compose components from M.E.AI, e.g. the OpenAI connector is effectively just: IChatClient client = new ChatClientBuilder(services)
.UseFunctionInvocation()
.UseOpenTelemetry()
.Use(openAIClient.AsChatClient(modelId)); At that point, SK will be fully layered on top of M.E.AI, providing its programming model and higher-level capabilities on top of the building blocks and exchange types from M.E.AI. |
Beta Was this translation helpful? Give feedback.
https://devblogs.microsoft.com/semantic-kernel/microsoft-extensions-ai-simplifying-ai-integration-for-net-partners/ this blog has a good overview and has some samples at the bottom as well.