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};

/// SendSubagentInputCallItemResource : A request to send input to another agent.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct SendSubagentInputCallItemResource {
    /// The item type. Always `send_subagent_input_call`.
    #[serde(rename = "type")]
    pub r#type: Type,
    /// The ID of the tool call item.
    #[serde(rename = "id")]
    pub id: String,
    /// The ID of the turn that contains this item.
    #[serde(rename = "turn_id")]
    pub turn_id: String,
    #[serde(rename = "status")]
    pub status: models::FunctionCallStatusResource,
    /// The ID of the agent sending the input.
    #[serde(rename = "sender_agent_id")]
    pub sender_agent_id: String,
    /// The ID of the agent receiving the input.
    #[serde(rename = "recipient_agent_id")]
    pub recipient_agent_id: String,
    /// The input sent to the receiving agent.
    #[serde(rename = "content")]
    pub content: Vec<models::AgentContentResource>,
}

impl SendSubagentInputCallItemResource {
    /// A request to send input to another agent.
    pub fn new(
        r#type: Type,
        id: String,
        turn_id: String,
        status: models::FunctionCallStatusResource,
        sender_agent_id: String,
        recipient_agent_id: String,
        content: Vec<models::AgentContentResource>,
    ) -> SendSubagentInputCallItemResource {
        SendSubagentInputCallItemResource {
            r#type,
            id,
            turn_id,
            status,
            sender_agent_id,
            recipient_agent_id,
            content,
        }
    }
}
/// The item type. Always `send_subagent_input_call`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "send_subagent_input_call")]
    SendSubagentInputCall,
}

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

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