vapi_client/models/
model_based_condition.rs

1/*
2 * Vapi API
3 *
4 * API for building voice assistants
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12
13use crate::models;
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ModelBasedCondition {
17    /// This condition is based on a model.
18    #[serde(rename = "type")]
19    pub r#type: Type,
20    /// This is the instruction which should output a boolean value when passed to a model.  You can reference any variable in the context of the current block execution (step): - \"{{output.your-property-name}}\" for current step's output - \"{{input.your-property-name}}\" for current step's input - \"{{your-step-name.output.your-property-name}}\" for another step's output (in the same workflow; read caveat #1) - \"{{your-step-name.input.your-property-name}}\" for another step's input (in the same workflow; read caveat #1) - \"{{your-block-name.output.your-property-name}}\" for another block's output (in the same workflow; read caveat #2) - \"{{your-block-name.input.your-property-name}}\" for another block's input (in the same workflow; read caveat #2) - \"{{workflow.input.your-property-name}}\" for the current workflow's input - \"{{global.your-property-name}}\" for the global context  You can also talk about the current step's output or input directly: - \"{{output.your-property-name}} is greater than 10\" - \"{{input.your-property-name}} is greater than 10\"  Examples:  - \"{{input.age}} is greater than 10\"  - \"{{input.age}} is greater than {{input.age2}}\"  - \"{{output.age}} is greater than 10\"  Caveats: 1. a workflow can execute a step multiple times. example, if a loop is used in the graph. {{stepName.input/output.propertyName}} will reference the latest usage of the step. 2. a workflow can execute a block multiple times. example, if a step is called multiple times or if a block is used in multiple steps. {{blockName.input/output.propertyName}} will reference the latest usage of the block. this liquid variable is just provided for convenience when creating blocks outside of a workflow with steps.
21    #[serde(rename = "instruction")]
22    pub instruction: String,
23}
24
25impl ModelBasedCondition {
26    pub fn new(r#type: Type, instruction: String) -> ModelBasedCondition {
27        ModelBasedCondition {
28            r#type,
29            instruction,
30        }
31    }
32}
33/// This condition is based on a model.
34#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
35pub enum Type {
36    #[serde(rename = "model-based")]
37    ModelBased,
38}
39
40impl Default for Type {
41    fn default() -> Type {
42        Self::ModelBased
43    }
44}