vapi_client/models/
conversation_node.rs

1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ConversationNode {
16    /// 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.
17    #[serde(rename = "type")]
18    pub r#type: TypeTrue,
19    #[serde(rename = "model", skip_serializing_if = "Option::is_none")]
20    pub model: Option<models::ConversationNodeModel>,
21    #[serde(rename = "transcriber", skip_serializing_if = "Option::is_none")]
22    pub transcriber: Option<models::ConversationNodeTranscriber>,
23    #[serde(rename = "voice", skip_serializing_if = "Option::is_none")]
24    pub voice: Option<models::ConversationNodeVoice>,
25    #[serde(rename = "prompt", skip_serializing_if = "Option::is_none")]
26    pub prompt: Option<String>,
27    /// This is the plan for the global node.
28    #[serde(rename = "globalNodePlan", skip_serializing_if = "Option::is_none")]
29    pub global_node_plan: Option<models::GlobalNodePlan>,
30    /// This is the plan that controls the variable extraction from the user's response.
31    #[serde(
32        rename = "variableExtractionPlan",
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub variable_extraction_plan: Option<models::VariableExtractionPlan>,
36    #[serde(rename = "name")]
37    pub name: String,
38    /// This is whether or not the node is the start of the workflow.
39    #[serde(rename = "isStart", skip_serializing_if = "Option::is_none")]
40    pub is_start: Option<bool>,
41    /// This is for metadata you want to store on the task.
42    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
43    pub metadata: Option<serde_json::Value>,
44}
45
46impl ConversationNode {
47    pub fn new(r#type: TypeTrue, name: String) -> ConversationNode {
48        ConversationNode {
49            r#type,
50            model: None,
51            transcriber: None,
52            voice: None,
53            prompt: None,
54            global_node_plan: None,
55            variable_extraction_plan: None,
56            name,
57            is_start: None,
58            metadata: None,
59        }
60    }
61}
62/// 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.
63#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
64pub enum TypeTrue {
65    #[serde(rename = "conversation")]
66    Conversation,
67}
68
69impl Default for TypeTrue {
70    fn default() -> TypeTrue {
71        Self::Conversation
72    }
73}