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 */
1011use crate::models;
12use serde::{Deserialize, Serialize};
1314#[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")]
18pub r#type: TypeTrue,
19#[serde(rename = "model", skip_serializing_if = "Option::is_none")]
20pub model: Option<models::ConversationNodeModel>,
21#[serde(rename = "transcriber", skip_serializing_if = "Option::is_none")]
22pub transcriber: Option<models::ConversationNodeTranscriber>,
23#[serde(rename = "voice", skip_serializing_if = "Option::is_none")]
24pub voice: Option<models::ConversationNodeVoice>,
25#[serde(rename = "prompt", skip_serializing_if = "Option::is_none")]
26pub prompt: Option<String>,
27/// This is the plan for the global node.
28#[serde(rename = "globalNodePlan", skip_serializing_if = "Option::is_none")]
29pub 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)]
35pub variable_extraction_plan: Option<models::VariableExtractionPlan>,
36#[serde(rename = "name")]
37pub 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")]
40pub 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")]
43pub metadata: Option<serde_json::Value>,
44}
4546impl ConversationNode {
47pub 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")]
66Conversation,
67}
6869impl Default for TypeTrue {
70fn default() -> TypeTrue {
71Self::Conversation
72 }
73}