mirror of
https://github.com/openai/codex.git
synced 2026-05-02 04:11:39 +03:00
Update realtime websocket API (#13265)
- migrate the realtime websocket transport to the new session and handoff flow - make the realtime model configurable in config.toml and use API-key auth for the websocket --------- Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -116,12 +116,32 @@ pub struct RealtimeAudioFrame {
|
||||
pub samples_per_channel: Option<u32>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS)]
|
||||
pub struct RealtimeHandoffMessage {
|
||||
pub role: String,
|
||||
pub text: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS)]
|
||||
pub struct RealtimeHandoffRequested {
|
||||
pub handoff_id: String,
|
||||
pub item_id: String,
|
||||
pub input_transcript: String,
|
||||
pub messages: Vec<RealtimeHandoffMessage>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS)]
|
||||
pub enum RealtimeEvent {
|
||||
SessionCreated { session_id: String },
|
||||
SessionUpdated { backend_prompt: Option<String> },
|
||||
SessionUpdated {
|
||||
session_id: String,
|
||||
instructions: Option<String>,
|
||||
},
|
||||
AudioOut(RealtimeAudioFrame),
|
||||
ConversationItemAdded(Value),
|
||||
ConversationItemDone {
|
||||
item_id: String,
|
||||
},
|
||||
HandoffRequested(RealtimeHandoffRequested),
|
||||
Error(String),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user