Skip to content

.Net: Add Ollama ChatClient Extensions + UT #12476

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 16, 2025

Conversation

RogerBarreto
Copy link
Member

Motivation and Context

Successfully implemented the missing AddOllamaChatClient extensions for the Ollama Connector with comprehensive testing.:

Key Features Implemented

Same Signature Patterns: All extensions follow the exact same parameter signatures as the existing IChatCompletionService extensions
IChatClient Target: Returns IChatClient instead of IChatCompletionService
Function Calling Support: Includes UseKernelFunctionInvocation() for function calling capabilities
Comprehensive Testing: Full test coverage for all scenarios including error handling, service registration, and functionality
Integration Ready: Integration tests are ready to run when secrets are configured

  • Implementation

    • Extension Methods Added
    • IServiceCollection Extensions: 3 overloads in OllamaServiceCollectionExtensions.DependencyInjection.cs
    • IKernelBuilder Extensions: 3 overloads in OllamaKernelBuilderExtensions.cs
  • Unit Tests Created:

    • OllamaServiceCollectionExtensionsChatClientTests.cs: 7 tests for service collection extensions
    • OllamaKernelBuilderExtensionsChatClientTests.cs: 6 tests for kernel builder extensions
    • OllamaChatClientTests.cs: 12 tests for IChatClient functionality
  • Integration Tests Created:

    • OllamaChatClientIntegrationTests.cs: 7 integration tests

@RogerBarreto RogerBarreto self-assigned this Jun 14, 2025
@RogerBarreto RogerBarreto requested a review from a team as a code owner June 14, 2025 14:52
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels Jun 14, 2025
@RogerBarreto RogerBarreto moved this to Sprint: In Review in Semantic Kernel Jun 14, 2025
@RogerBarreto RogerBarreto changed the title .Net: Ollama - Add ChatClient Extensions + UT .Net: Add Ollama ChatClient Extensions + UT Jun 14, 2025
@RogerBarreto RogerBarreto enabled auto-merge June 16, 2025 16:32
@RogerBarreto RogerBarreto added this pull request to the merge queue Jun 16, 2025
Merged via the queue into microsoft:main with commit bbc66df Jun 16, 2025
21 checks passed
@github-project-automation github-project-automation bot moved this from Sprint: In Review to Sprint: Done in Semantic Kernel Jun 16, 2025
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
Projects
Status: Sprint: Done
Development

Successfully merging this pull request may close these issues.

4 participants