fix(core) switching model appends model instructions (#10651)

## Summary
When switching models, we should append the instructions of the new
model to the conversation as a developer message.

## Test
- [x] Adds a unit test
This commit is contained in:
Dylan Hurd authored and GitHub committed 2026-02-05 05:50:38 +00:00
1 parent a05aadfa1b
commit e482978261
7 files changed
+261 -4

No files matched your search

+6
View File
@@ -274,6 +274,12 @@ impl DeveloperInstructions {
Self { text }
}
pub fn model_switch_message(model_instructions: String) -> Self {
DeveloperInstructions::new(format!(
"<model_switch>\nThe user was previously using a different model. Please continue the conversation according to the following instructions:\n\n{model_instructions}\n</model_switch>"
))
}
pub fn personality_spec_message(spec: String) -> Self {
let message = format!(
"<personality_spec> The user has requested a new communication style. Future messages should adhere to the following personality: \n{spec} </personality_spec>"