diff --git a/src/realtime/types.rs b/src/realtime/types.rs index a18db24..0cc70d9 100644 --- a/src/realtime/types.rs +++ b/src/realtime/types.rs @@ -218,6 +218,8 @@ pub enum ResponseStatus { #[derive(Debug, Serialize, Deserialize, Clone)] #[serde(tag = "type")] pub enum ResponseStatusDetail { + #[serde(rename = "cancelled")] + Cancelled { reason: CancelledReason }, #[serde(rename = "incomplete")] Incomplete { reason: IncompleteReason }, #[serde(rename = "failed")] @@ -230,6 +232,13 @@ pub struct FailedError { pub message: String, } +#[derive(Debug, Serialize, Deserialize, Clone)] +#[serde(rename_all = "snake_case")] +pub enum CancelledReason { + TurnDetected, + ClientCancelled, +} + #[derive(Debug, Serialize, Deserialize, Clone)] #[serde(rename_all = "snake_case")] pub enum IncompleteReason {