openai-client-base 0.12.0

Auto-generated Rust client for the OpenAI API
/*
 * OpenAI API
 *
 * The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
 *
 * The version of the OpenAPI document: 2.3.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct RealtimeSessionCreateResponseGaAudioOutput {
    #[serde(rename = "format", skip_serializing_if = "Option::is_none")]
    pub format: Option<Box<models::RealtimeAudioFormats>>,
    /// Model identifier as string
    #[serde(rename = "voice", skip_serializing_if = "Option::is_none")]
    pub voice: Option<String>,
    /// The speed of the model's spoken response as a multiple of the original speed. 1.0 is the default speed. 0.25 is the minimum speed. 1.5 is the maximum speed. This value can only be changed in between model turns, not while a response is in progress.  This parameter is a post-processing adjustment to the audio after it is generated, it's also possible to prompt the model to speak faster or slower.
    #[serde(rename = "speed", skip_serializing_if = "Option::is_none")]
    pub speed: Option<f64>,
}

impl RealtimeSessionCreateResponseGaAudioOutput {
    pub fn new() -> RealtimeSessionCreateResponseGaAudioOutput {
        RealtimeSessionCreateResponseGaAudioOutput {
            format: None,
            voice: None,
            speed: None,
        }
    }
}

impl std::fmt::Display for RealtimeSessionCreateResponseGaAudioOutput {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match serde_json::to_string(self) {
            Ok(s) => write!(f, "{}", s),
            Err(_) => Err(std::fmt::Error),
        }
    }
}