Skip to content

Bug: Adding Ollama completion to the kernel still requires the ollama client #10346

Closed

Description

After #10321 was fixed I noticed that when I use the following code to add the Ollama chat completion, I expected to be able to omit the API client, but I can't.

var builder = WebApplication.CreateBuilder(args);

builder.AddOllamaApiClient("languageModel");
builder.Services.AddKernel().AddOllamaChatCompletion();

The code in the OllamaKernelBuilder requires the Ollama client still. It should be made optional.

public static IKernelBuilder AddOllamaChatCompletion(
this IKernelBuilder builder,
OllamaApiClient ollamaClient,
string? serviceId = null)
{
Verify.NotNull(builder);
builder.Services.AddOllamaChatCompletion(ollamaClient, serviceId);
return builder;
}

Activity

  1. changed the title [-]Bug:[/-] [+].Net: Bug:[/+] on Jan 30, 2025
  2. changed the title [-].Net: Bug:[/-] [+]Bug: Adding Ollama completion to the kernel still requires the ollama client[/+] on Jan 30, 2025
  3. rogerbarreto commented on Mar 30, 2025

    @rogerbarreto
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

.NETIssue or Pull requests regarding .NET codebugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions