mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
Prefix handoff messages with role
This commit is contained in:
@@ -376,7 +376,7 @@ fn realtime_text_from_handoff_request(handoff: &RealtimeHandoffRequested) -> Opt
|
||||
let messages = handoff
|
||||
.messages
|
||||
.iter()
|
||||
.map(|message| message.text.as_str())
|
||||
.map(|message| format!("{}: {}", message.role, message.text))
|
||||
.collect::<Vec<_>>()
|
||||
.join("\n");
|
||||
(!messages.is_empty()).then_some(messages).or_else(|| {
|
||||
@@ -605,7 +605,7 @@ mod tests {
|
||||
};
|
||||
assert_eq!(
|
||||
realtime_text_from_handoff_request(&handoff),
|
||||
Some("hello\nhi there".to_string())
|
||||
Some("user: hello\nassistant: hi there".to_string())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user