vapi_client/models/
handoff_step_block.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};
12use utoipa::OpenApi;
13
14
15use crate::models;
16
17/// HandoffStepBlock : This is the block to use. To use an existing block, use `blockId`.
18/// This is the block to use. To use an existing block, use `blockId`.
19#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, OpenApi)]
20#[serde(untagged)]
21pub enum HandoffStepBlock {
22    CreateConversationBlockDto(models::CreateConversationBlockDto),
23    CreateToolCallBlockDto(models::CreateToolCallBlockDto),
24    CreateWorkflowBlockDto(models::CreateWorkflowBlockDto),
25}
26
27impl Default for HandoffStepBlock {
28    fn default() -> Self {
29        Self::CreateConversationBlockDto(Default::default())
30    }
31}
32/// This block is used for conversation. This can be a free flow conversation or a conversation with a specific goal like collecting some information.  For free block conversation, put clearly in the `instruction` when the block can be considered done. ``` {  \"type\": \"conversation\",  \"instruction\": \"Chit chat with the user asking them about their day. When user asks a specific question or once you have talked to the user for a couple of turns of conversation, move on.\" } ```  For conversation with a specific goal, you can define an `outputSchema` with required fields. The block won't be considered done until the user has provided all the required fields in the `outputSchema`. ``` {  \"type\": \"conversation\",  \"instruction\": \"Ask the user about their hobbies, hopes and dreams.\",  \"outputSchema\": {    \"type\": \"object\",    \"properties\": {      \"hobbies\": {        \"type\": \"string\"      },      \"hopes\": {        \"type\": \"string\"      },      \"dreams\": {        \"type\": \"string\"      }    },    \"required\": [\"hobbies\"]  } } ``` For the above example, the conversation block will be considered done once the user has provided the `hobbies` (even if they have not provided the `hopes` and `dreams`).
33#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, OpenApi)]
34pub enum Type {
35    #[serde(rename = "conversation")]
36    Conversation,
37    #[serde(rename = "tool-call")]
38    ToolCall,
39    #[serde(rename = "workflow")]
40    Workflow,
41}
42
43impl Default for Type {
44    fn default() -> Type {
45        Self::Conversation
46    }
47}