diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 507eaa58..0ebbbfb1 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -57,7 +57,7 @@ - + diff --git a/src/Providers/Ollama/src/OllamaChatModel.cs b/src/Providers/Ollama/src/OllamaChatModel.cs index a08a6c2c..d675aad1 100644 --- a/src/Providers/Ollama/src/OllamaChatModel.cs +++ b/src/Providers/Ollama/src/OllamaChatModel.cs @@ -32,18 +32,18 @@ public override async Task GenerateAsync( { request = request ?? throw new ArgumentNullException(nameof(request)); - await Provider.Api.PullModelAndEnsureSuccessAsync(Id, cancellationToken: cancellationToken).ConfigureAwait(false); + await Provider.Api.Models.PullModelAndEnsureSuccessAsync(Id, cancellationToken: cancellationToken).ConfigureAwait(false); var prompt = ToPrompt(request.Messages); var watch = Stopwatch.StartNew(); - var response = Provider.Api.GenerateCompletionAsync(new GenerateCompletionRequest + var response = Provider.Api.Completions.GenerateCompletionAsync(new GenerateCompletionRequest { Prompt = prompt, Model = Id, Options = Provider.Options, Stream = true, Raw = true, - Format = UseJson ? "json" : string.Empty, + Format = UseJson ? GenerateCompletionRequestFormat.Json : null, }, cancellationToken); OnPromptSent(prompt); diff --git a/src/Providers/Ollama/src/OllamaEmbeddingModel.cs b/src/Providers/Ollama/src/OllamaEmbeddingModel.cs index 9d739099..fab55f73 100644 --- a/src/Providers/Ollama/src/OllamaEmbeddingModel.cs +++ b/src/Providers/Ollama/src/OllamaEmbeddingModel.cs @@ -25,12 +25,12 @@ public async Task CreateEmbeddingsAsync( { request = request ?? throw new ArgumentNullException(nameof(request)); - await Provider.Api.PullModelAndEnsureSuccessAsync(Id, cancellationToken: cancellationToken).ConfigureAwait(false); + await Provider.Api.Models.PullModelAndEnsureSuccessAsync(Id, cancellationToken: cancellationToken).ConfigureAwait(false); var results = new List>(capacity: request.Strings.Count); foreach (var prompt in request.Strings) { - var response = await Provider.Api.GenerateEmbeddingAsync(new GenerateEmbeddingRequest + var response = await Provider.Api.Embeddings.GenerateEmbeddingAsync(new GenerateEmbeddingRequest { Prompt = prompt, Model = Id,