From 3c60b0c8af79fc5e54d8a1576cc1218ad9551eb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Wed, 4 Mar 2026 13:25:47 -0800 Subject: [PATCH] Add changelog for #3918 --- changelog/3918.added.md | 15 +++++++++++++++ changelog/3918.other.md | 1 + 2 files changed, 16 insertions(+) create mode 100644 changelog/3918.added.md create mode 100644 changelog/3918.other.md diff --git a/changelog/3918.added.md b/changelog/3918.added.md new file mode 100644 index 000000000..6b4d4446f --- /dev/null +++ b/changelog/3918.added.md @@ -0,0 +1,15 @@ +- Wired up `system_instruction` in `BaseOpenAILLMService`, `AnthropicLLMService`, and `AWSBedrockLLMService` so it works as a default system prompt, matching the behavior of the Google services. This enables sharing a single `LLMContext` across multiple LLM services, where each service provides its own system instruction independently. + + ```python + llm = OpenAILLMService( + api_key=os.getenv("OPENAI_API_KEY"), + system_instruction="You are a helpful assistant.", + ) + + context = LLMContext() + + @transport.event_handler("on_client_connected") + async def on_client_connected(transport, client): + context.add_message({"role": "user", "content": "Please introduce yourself."}) + await task.queue_frames([LLMRunFrame()]) + ``` diff --git a/changelog/3918.other.md b/changelog/3918.other.md new file mode 100644 index 000000000..6caa1ba05 --- /dev/null +++ b/changelog/3918.other.md @@ -0,0 +1 @@ +- Updated foundational examples to use `system_instruction` on LLM services instead of adding system messages to `LLMContext`.