mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
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:
1 parent
a05aadfa1b
commit
e482978261
7 files changed
+261
-4
No files matched your search
@@ -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>"
|
||||
|
||||
Reference in new issue
Block a user