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};
12
13use crate::models;
14
15/// HandoffStepBlock : This is the block to use. To use an existing block, use `blockId`.
16/// This is the block to use. To use an existing block, use `blockId`.
17#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
18#[serde(untagged)]
19pub enum HandoffStepBlock {
20 CreateConversationBlockDto(models::CreateConversationBlockDto),
21 CreateToolCallBlockDto(models::CreateToolCallBlockDto),
22 CreateWorkflowBlockDto(models::CreateWorkflowBlockDto),
23}
24
25impl Default for HandoffStepBlock {
26 fn default() -> Self {
27 Self::CreateConversationBlockDto(Default::default())
28 }
29}
30/// 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`).
31#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
32pub enum Type {
33 #[serde(rename = "conversation")]
34 Conversation,
35 #[serde(rename = "tool-call")]
36 ToolCall,
37 #[serde(rename = "workflow")]
38 Workflow,
39}
40
41impl Default for Type {
42 fn default() -> Type {
43 Self::Conversation
44 }
45}