Move system_instruction into LLMSettings

Add `system_instruction` field to `LLMSettings` so it is runtime-updatable via settings.
For Google (GoogleLLMService, GoogleVertexLLMService), deprecate the init-time arg since it was already shipped. For Anthropic, AWS Bedrock, and OpenAI, remove the init-time arg entirely since it was never shipped.

Add system instruction prepend logic to `build_chat_completion_params` overrides in Cerebras, SambaNova, Fireworks, Mistral, and Perplexity, which build params from scratch rather than calling `super()`.

Still need to handle realtime services (OpenAI Realtime, Grok Realtime, Gemini Live).
This commit is contained in:
Paul Kompfner
2026-03-05 14:03:32 -05:00
parent 1fcae91e5d
commit 560d2306e8
223 changed files with 860 additions and 424 deletions

View File

@@ -227,13 +227,13 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
api_key=os.getenv("OPENAI_API_KEY"),
settings=OpenAILLMSettings(
model="gpt-4o-mini",
),
system_instruction="""You are a personal assistant. You can remember things about the person you are talking to.
system_instruction="""You are a personal assistant. You can remember things about the person you are talking to.
Some Guidelines:
- Make sure your responses are friendly yet short and concise.
- If the user asks you to remember something, make sure to remember it.
- Greet the user by their name if you know about it.
""",
),
)
# Set up conversation context and management