From 945aa51b9be4c6c072a08470b38410419e1da493 Mon Sep 17 00:00:00 2001 From: Ronny Hanssen Date: Thu, 19 Mar 2026 15:01:05 +0100 Subject: [PATCH] fix(ai-ollama): forward systemPrompts to Ollama API The `mapCommonOptionsToOllama()` method was silently dropping the `systemPrompts` field from chat options. System prompts passed via `chat({ systemPrompts: [...] })` now correctly reach the Ollama API as the `system` parameter on the chat request. This is how other adapters (e.g. Anthropic) handle it. --- packages/typescript/ai-ollama/src/adapters/text.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/typescript/ai-ollama/src/adapters/text.ts b/packages/typescript/ai-ollama/src/adapters/text.ts index e96bd52e1..2067ab2a3 100644 --- a/packages/typescript/ai-ollama/src/adapters/text.ts +++ b/packages/typescript/ai-ollama/src/adapters/text.ts @@ -452,6 +452,9 @@ export class OllamaTextAdapter extends BaseTextAdapter< options: ollamaOptions, messages: this.formatMessages(options.messages), tools: this.convertToolsToOllamaFormat(options.tools), + ...(options.systemPrompts?.length + ? { system: options.systemPrompts.join('\n') } + : {}), } } }