Skip to content

Commit b8dbb2d

Browse files
authored
fix(ai-ollama): forward systemPrompts to Ollama API (#389)
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.
1 parent 7d79347 commit b8dbb2d

File tree

1 file changed

+3
-0
lines changed
  • packages/typescript/ai-ollama/src/adapters

1 file changed

+3
-0
lines changed

packages/typescript/ai-ollama/src/adapters/text.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,9 @@ export class OllamaTextAdapter<TModel extends string> extends BaseTextAdapter<
483483
options: ollamaOptions,
484484
messages: this.formatMessages(options.messages),
485485
tools: this.convertToolsToOllamaFormat(options.tools),
486+
...(options.systemPrompts?.length
487+
? { system: options.systemPrompts.join('\n') }
488+
: {}),
486489
}
487490
}
488491
}

0 commit comments

Comments
 (0)