Skip to content

.Net: SK integration with MEAI Abstractions - #10754

Merged
Roger Barreto (rogerbarreto) merged 54 commits into
mainfrom
feature-msextensions-ai
May 20, 2025
Merged

Roger Barreto (rogerbarreto) merged 54 commits into
mainfrom
feature-msextensions-ai

Conversation

…nts) Phase 1 (#10651)

### Motivation and Context

- Resolves partially #10319 

This change adds a new `IChatClientSelector` abstraction to work without
breaking current `IAIServiceSelector` implementations.

This was necessary because `Kernel` now will be able to resolve
`IChatClient`s which are not `IAIService` implementations, and
`OrderedAIServiceSelector` now can select not only `AIServices` but
`ChatClients` as well by implementing the `IChatClientSelector`
interface.

All other changes are related to test accepting `IChatClient`s added to
the `Service` DI container, ensuring they work as expected together with
current `IChatCOmpletionService` and `ITextGenerationService` in the
`Kernel`.
@markwallace-microsoft Mark Wallace (markwallace-microsoft) added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel kernel.core labels Mar 3, 2025
@rogerbarreto Roger Barreto (rogerbarreto) changed the title .Net: SK integration with MEAI Abstractions .Net: SK integration with MEAI Abstractions (Main Sync) - WIP Mar 3, 2025
@github-actions github-actions Bot changed the title .Net: SK integration with MEAI Abstractions (Main Sync) - WIP .Net: SK integration with MEAI Abstractions Mar 3, 2025
@rogerbarreto Roger Barreto (rogerbarreto) added the PR: in progress Under development and/or addressing feedback label Mar 3, 2025
…1049)

# Add ChatClient Support to ChatCompletionAgent

- Resolve #10729 

## Motivation and Context

This PR enhances ChatCompletionAgent to support `IChatClient` alongside
existing IChatCompletionService, providing more flexibility in how chat
completions are handled. This enables better integration with existing
`Microsoft.Extensions.AI` types.

## Description

### Core Changes

1. Enhanced ChatCompletionAgent to:
   - Support both IChatClient and IChatCompletionService interfaces
   - Maintain backward compatibility with existing implementations

2. Updated Sample Code:
   - Added new examples in Concepts demonstrating ChatClient usage
- Updated Getting Started With Agents samples to showcase both service
types

3. Added Comprehensive Unit Tests:
   - Test coverage for Agents with ChatClient integration
   - Verification of both streaming and non-streaming scenarios

4. Added `IChatClient.AsKernelFunctionInvokingClient` extension method
to enable Kernel Function Invocation support with `IChatClient` for
solutions that target `.NET 8 LTS` only.
…ilderPattern (#12132)

- Resolves #12087 
- Add KernelChatOptions to avoid undesired leaking serializations to AI
Models.
- Added More ChatClient Extension methods to Amazon Bedrock and Azure AI
Inference
- Updated existing ChatClient using the latest changes, 
- Code improvements/clean up.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes have been reviewed on their way into the feature branch

@rogerbarreto
Roger Barreto (rogerbarreto) added this pull request to the merge queue May 20, 2025
Merged via the queue into main with commit 57bac49 May 20, 2025
@rogerbarreto
Roger Barreto (rogerbarreto) deleted the feature-msextensions-ai branch May 20, 2025 14:49
jcruzmot-te pushed a commit to thousandeyes/aia-semantic-kernel that referenced this pull request Sep 15, 2025
## Microsoft Extensions AI Integration

This PR brings native integration to majority of
`Microsoft.Extensions.AI` abstractions into Semantic Kernel components
and API's.

- Resolves microsoft#10081 
  Including:
  - microsoft#11628
  - microsoft#11619
  - microsoft#10727
  - microsoft#10729
  - microsoft#10730
  - microsoft#12132

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: NEWTON MALLICK <[email protected]>
Co-authored-by: SergeyMenshykh <[email protected]>
Co-authored-by: Roger Barreto <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Eduard van Valkenburg <[email protected]>
Co-authored-by: westey <[email protected]>
Co-authored-by: Phil Jirsa <[email protected]>
Co-authored-by: DavidJFowler <[email protected]>
Co-authored-by: Evan Mattson <[email protected]>
Co-authored-by: Tao Chen <[email protected]>
Co-authored-by: Tommaso Stocchi <[email protected]>
Co-authored-by: Chris <[email protected]>
Co-authored-by: Mark Wallace <[email protected]>
Co-authored-by: Dade Cook <[email protected]>
Co-authored-by: Dade Cook <[email protected]>

This branch was previously deployed

1 inactive deployment
integration — 50c66756 Deployed May 20, 2025 by markwallace-microsoft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel.core kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code PR: in progress Under development and/or addressing feedback

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.Net: Native Integration with Microsoft.Extensions.AI - Phase 1

3 participants