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 ToolNode {
    /// This is the Tool node. This can be used to call a tool in your workflow.  The flow is: - Workflow starts the tool node - Model is called to extract parameters needed by the tool from the conversation history - Tool is called with the parameters - Server returns a response - Workflow continues with the response
    #[serde(rename = "type")]
    pub r#type: TypeTrue,
    #[serde(rename = "tool", skip_serializing_if = "Option::is_none")]
    pub tool: Option<models::ToolNodeTool>,
    /// This is the tool to call. To use a transient tool, send `tool` instead.
    #[serde(rename = "toolId", skip_serializing_if = "Option::is_none")]
    pub tool_id: Option<String>,
    #[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 ToolNode {
    pub fn new(r#type: TypeTrue, name: String) -> ToolNode {
        ToolNode {
            r#type,
            tool: None,
            tool_id: None,
            name,
            is_start: None,
            metadata: None,
        }
    }
}
/// This is the Tool node. This can be used to call a tool in your workflow.  The flow is: - Workflow starts the tool node - Model is called to extract parameters needed by the tool from the conversation history - Tool is called with the parameters - Server returns a response - Workflow continues with the response
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TypeTrue {
    #[serde(rename = "tool")]
    Tool,
}

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