summaryrefslogtreecommitdiff
path: root/src/Agent.Core/Ollama/OllamaClient.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Agent.Core/Ollama/OllamaClient.cs')
-rw-r--r--src/Agent.Core/Ollama/OllamaClient.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Agent.Core/Ollama/OllamaClient.cs b/src/Agent.Core/Ollama/OllamaClient.cs
index 428bca9..fea5dfb 100644
--- a/src/Agent.Core/Ollama/OllamaClient.cs
+++ b/src/Agent.Core/Ollama/OllamaClient.cs
@@ -57,7 +57,7 @@ public sealed class OllamaClient : IOllamaClient
Model = _settings.Model,
Messages = messages,
Stream = false,
- Think = thinkOverride ?? _settings.Think,
+ Think = thinkOverride is null ? _settings.Think : thinkOverride.Value,
KeepAlive = _settings.KeepAlive,
Options = options,
Tools = tools?.Select(static tool => new OllamaToolDefinition("function", new OllamaFunctionDefinition(tool.Name, tool.Description, tool.Parameters))).ToArray(),
@@ -85,7 +85,8 @@ public sealed class OllamaClient : IOllamaClient
?? throw new OllamaException("Ollama returned an empty response.", false);
if (!string.IsNullOrWhiteSpace(result.Error)) throw new OllamaException(result.Error, false);
if (result.Message is null) throw new OllamaException("Ollama response has no message.", false);
- return new OllamaResult(result.Message.Content, result.PromptEvalCount, result.EvalCount, result.Message.ToolCalls ?? [], result.PromptEvalCount);
+ return new OllamaResult(result.Message.Content, result.PromptEvalCount, result.EvalCount,
+ result.Message.ToolCalls ?? [], result.PromptEvalCount, result.Message.Thinking);
}
catch (Exception ex) when (ex is HttpRequestException or TaskCanceledException && !cancellationToken.IsCancellationRequested)
{