openai-client-base 0.16.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, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct BetaMultiAgentCallOutput {
    #[serde(rename = "agent", skip_serializing_if = "Option::is_none")]
    pub agent: Option<Box<models::BetaAgentTag>>,
    /// The type of the multi-agent result. Always `multi_agent_call_output`.
    #[serde(rename = "type")]
    pub r#type: Type,
    /// The unique ID of the multi-agent call output item.
    #[serde(rename = "id")]
    pub id: String,
    /// The unique ID of the multi-agent call.
    #[serde(rename = "call_id")]
    pub call_id: String,
    #[serde(rename = "action")]
    pub action: models::BetaMultiAgentAction,
    /// Text output returned by the multi-agent action.
    #[serde(rename = "output")]
    pub output: Vec<models::BetaOutputTextContent>,
}

impl BetaMultiAgentCallOutput {
    pub fn new(
        r#type: Type,
        id: String,
        call_id: String,
        action: models::BetaMultiAgentAction,
        output: Vec<models::BetaOutputTextContent>,
    ) -> BetaMultiAgentCallOutput {
        BetaMultiAgentCallOutput {
            agent: None,
            r#type,
            id,
            call_id,
            action,
            output,
        }
    }
}
/// The type of the multi-agent result. Always `multi_agent_call_output`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "multi_agent_call_output")]
    MultiAgentCallOutput,
}

impl Default for Type {
    fn default() -> Type {
        Self::MultiAgentCallOutput
    }
}

impl std::fmt::Display for BetaMultiAgentCallOutput {
    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),
        }
    }
}