Add realtime voice selection (#17176)

- Add realtime voice selection for realtime/start.
- Expose the supported v1/v2 voice lists and cover explicit, configured,
default, and invalid voice paths.
This commit is contained in:
Ahmed Ibrahim
2026-04-08 20:19:15 -07:00
committed by GitHub
parent 4c2a1ae31b
commit 2f9090be62
36 changed files with 860 additions and 33 deletions

View File

@@ -414,6 +414,11 @@ client_request_definitions! {
params: v2::ThreadRealtimeStopParams,
response: v2::ThreadRealtimeStopResponse,
},
#[experimental("thread/realtime/listVoices")]
ThreadRealtimeListVoices => "thread/realtime/listVoices" {
params: v2::ThreadRealtimeListVoicesParams,
response: v2::ThreadRealtimeListVoicesResponse,
},
ReviewStart => "review/start" {
params: v2::ReviewStartParams,
response: v2::ReviewStartResponse,
@@ -1764,6 +1769,7 @@ mod tests {
prompt: Some(Some("You are on a call".to_string())),
session_id: Some("sess_456".to_string()),
transport: None,
voice: Some(codex_protocol::protocol::RealtimeVoice::Marin),
},
};
assert_eq!(
@@ -1774,7 +1780,8 @@ mod tests {
"threadId": "thr_123",
"prompt": "You are on a call",
"sessionId": "sess_456",
"transport": null
"transport": null,
"voice": "marin"
}
}),
serde_json::to_value(&request)?,
@@ -1791,6 +1798,7 @@ mod tests {
prompt: None,
session_id: None,
transport: None,
voice: None,
},
};
assert_eq!(
@@ -1800,7 +1808,8 @@ mod tests {
"params": {
"threadId": "thr_123",
"sessionId": null,
"transport": null
"transport": null,
"voice": null
}
}),
serde_json::to_value(&default_prompt_request)?,
@@ -1813,6 +1822,7 @@ mod tests {
prompt: Some(None),
session_id: None,
transport: None,
voice: None,
},
};
assert_eq!(
@@ -1823,7 +1833,8 @@ mod tests {
"threadId": "thr_123",
"prompt": null,
"sessionId": null,
"transport": null
"transport": null,
"voice": null
}
}),
serde_json::to_value(&null_prompt_request)?,
@@ -1835,7 +1846,8 @@ mod tests {
"params": {
"threadId": "thr_123",
"sessionId": null,
"transport": null
"transport": null,
"voice": null
}
});
assert_eq!(
@@ -1850,7 +1862,8 @@ mod tests {
"threadId": "thr_123",
"prompt": null,
"sessionId": null,
"transport": null
"transport": null,
"voice": null
}
});
assert_eq!(
@@ -1934,6 +1947,7 @@ mod tests {
prompt: Some(Some("You are on a call".to_string())),
session_id: None,
transport: None,
voice: None,
},
};
let reason = crate::experimental_api::ExperimentalApi::experimental_reason(&request);