Add system_instruction parameter to run_inference (#3968)

* Add system_instruction parameter to run_inference

Allow callers to provide a custom system instruction directly when calling
run_inference, without having to construct provider-specific context objects.

For OpenAI, the instruction is prepended as a system message (preserving
existing messages). For Anthropic, Google, and AWS Bedrock, it overrides the
single system field with a warning when an existing system instruction is
present in the context.

* Use system_instruction parameter in _generate_summary

Pass the summarization prompt via run_inference's system_instruction
parameter instead of embedding it as a system message in the context.

* Add changelog for #3968
This commit is contained in:
Mark Backman
2026-03-10 12:57:23 -04:00
committed by GitHub
parent 0817a57f4c
commit 912f1be31c
8 changed files with 332 additions and 21 deletions

1
changelog/3968.added.md Normal file
View File

@@ -0,0 +1 @@
- Added `system_instruction` parameter to `run_inference` across all LLM services, allowing callers to override the system prompt for one-shot inference calls. Used by `_generate_summary` to pass the summarization prompt cleanly.