vapi-client 0.4.2

Unofficial crate for Vapi - Voice AI for developers.
Documentation
/*
 * Vapi API
 *
 * Voice AI for developers.
 *
 * The version of the OpenAPI document: 1.0
 *
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ConversationNode {
    /// This is the Conversation node. This can be used to start a conversation with the customer.  The flow is: - Workflow starts the conversation node - Model is active with the `prompt` and global context. - Model will call a tool to exit this node. - Workflow will extract variables from the conversation. - Workflow continues.
    #[serde(rename = "type")]
    pub r#type: TypeTrue,
    #[serde(rename = "model", skip_serializing_if = "Option::is_none")]
    pub model: Option<models::ConversationNodeModel>,
    #[serde(rename = "transcriber", skip_serializing_if = "Option::is_none")]
    pub transcriber: Option<models::ConversationNodeTranscriber>,
    #[serde(rename = "voice", skip_serializing_if = "Option::is_none")]
    pub voice: Option<models::ConversationNodeVoice>,
    #[serde(rename = "prompt", skip_serializing_if = "Option::is_none")]
    pub prompt: Option<String>,
    /// This is the plan for the global node.
    #[serde(rename = "globalNodePlan", skip_serializing_if = "Option::is_none")]
    pub global_node_plan: Option<models::GlobalNodePlan>,
    /// This is the plan that controls the variable extraction from the user's response.
    #[serde(
        rename = "variableExtractionPlan",
        skip_serializing_if = "Option::is_none"
    )]
    pub variable_extraction_plan: Option<models::VariableExtractionPlan>,
    #[serde(rename = "name")]
    pub name: String,
    /// This is whether or not the node is the start of the workflow.
    #[serde(rename = "isStart", skip_serializing_if = "Option::is_none")]
    pub is_start: Option<bool>,
    /// This is for metadata you want to store on the task.
    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<serde_json::Value>,
}

impl ConversationNode {
    pub fn new(r#type: TypeTrue, name: String) -> ConversationNode {
        ConversationNode {
            r#type,
            model: None,
            transcriber: None,
            voice: None,
            prompt: None,
            global_node_plan: None,
            variable_extraction_plan: None,
            name,
            is_start: None,
            metadata: None,
        }
    }
}
/// This is the Conversation node. This can be used to start a conversation with the customer.  The flow is: - Workflow starts the conversation node - Model is active with the `prompt` and global context. - Model will call a tool to exit this node. - Workflow will extract variables from the conversation. - Workflow continues.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TypeTrue {
    #[serde(rename = "conversation")]
    Conversation,
}

impl Default for TypeTrue {
    fn default() -> TypeTrue {
        Self::Conversation
    }
}