vapi_client/models/
transfer_destination_assistant.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::ToSchema;
13
14
15use crate::models;
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, ToSchema)]
18pub struct TransferDestinationAssistant {
19    #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
20    pub message: Option<models::TransferDestinationAssistantMessage>,
21    #[serde(rename = "type")]
22    pub r#type: Type,
23    /// This is the mode to use for the transfer. Defaults to `rolling-history`.  - `rolling-history`: This is the default mode. It keeps the entire conversation history and appends the new assistant's system message on transfer.    Example:    Pre-transfer:     system: assistant1 system message     assistant: assistant1 first message     user: hey, good morning     assistant: how can i help?     user: i need help with my account     assistant: (destination.message)    Post-transfer:     system: assistant1 system message     assistant: assistant1 first message     user: hey, good morning     assistant: how can i help?     user: i need help with my account     assistant: (destination.message)     system: assistant2 system message     assistant: assistant2 first message (or model generated if firstMessageMode is set to `assistant-speaks-first-with-model-generated-message`)  - `swap-system-message-in-history`: This replaces the original system message with the new assistant's system message on transfer.    Example:    Pre-transfer:     system: assistant1 system message     assistant: assistant1 first message     user: hey, good morning     assistant: how can i help?     user: i need help with my account     assistant: (destination.message)    Post-transfer:     system: assistant2 system message     assistant: assistant1 first message     user: hey, good morning     assistant: how can i help?     user: i need help with my account     assistant: (destination.message)     assistant: assistant2 first message (or model generated if firstMessageMode is set to `assistant-speaks-first-with-model-generated-message`)  - `delete-history`: This deletes the entire conversation history on transfer.    Example:    Pre-transfer:     system: assistant1 system message     assistant: assistant1 first message     user: hey, good morning     assistant: how can i help?     user: i need help with my account     assistant: (destination.message)    Post-transfer:     system: assistant2 system message     assistant: assistant2 first message     user: Yes, please     assistant: how can i help?     user: i need help with my account  - `swap-system-message-in-history-and-remove-transfer-tool-messages`: This replaces the original system message with the new assistant's system message on transfer and removes transfer tool messages from conversation history sent to the LLM.    Example:    Pre-transfer:     system: assistant1 system message     assistant: assistant1 first message     user: hey, good morning     assistant: how can i help?     user: i need help with my account     transfer-tool     transfer-tool-result     assistant: (destination.message)    Post-transfer:     system: assistant2 system message     assistant: assistant1 first message     user: hey, good morning     assistant: how can i help?     user: i need help with my account     assistant: (destination.message)     assistant: assistant2 first message (or model generated if firstMessageMode is set to `assistant-speaks-first-with-model-generated-message`)  @default 'rolling-history'
24    #[serde(rename = "transferMode", skip_serializing_if = "Option::is_none")]
25    pub transfer_mode: Option<TransferMode>,
26    /// This is the assistant to transfer the call to.
27    #[serde(rename = "assistantName")]
28    pub assistant_name: String,
29    /// This is the description of the destination, used by the AI to choose when and how to transfer the call.
30    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
31    pub description: Option<String>,
32}
33
34impl TransferDestinationAssistant {
35    pub fn new(r#type: Type, assistant_name: String) -> TransferDestinationAssistant {
36        TransferDestinationAssistant {
37            message: None,
38            r#type,
39            transfer_mode: None,
40            assistant_name,
41            description: None,
42        }
43    }
44}
45///
46#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, ToSchema)]
47pub enum Type {
48    #[serde(rename = "assistant")]
49    Assistant,
50}
51
52impl Default for Type {
53    fn default() -> Type {
54        Self::Assistant
55    }
56}
57/// This is the mode to use for the transfer. Defaults to `rolling-history`.  - `rolling-history`: This is the default mode. It keeps the entire conversation history and appends the new assistant's system message on transfer.    Example:    Pre-transfer:     system: assistant1 system message     assistant: assistant1 first message     user: hey, good morning     assistant: how can i help?     user: i need help with my account     assistant: (destination.message)    Post-transfer:     system: assistant1 system message     assistant: assistant1 first message     user: hey, good morning     assistant: how can i help?     user: i need help with my account     assistant: (destination.message)     system: assistant2 system message     assistant: assistant2 first message (or model generated if firstMessageMode is set to `assistant-speaks-first-with-model-generated-message`)  - `swap-system-message-in-history`: This replaces the original system message with the new assistant's system message on transfer.    Example:    Pre-transfer:     system: assistant1 system message     assistant: assistant1 first message     user: hey, good morning     assistant: how can i help?     user: i need help with my account     assistant: (destination.message)    Post-transfer:     system: assistant2 system message     assistant: assistant1 first message     user: hey, good morning     assistant: how can i help?     user: i need help with my account     assistant: (destination.message)     assistant: assistant2 first message (or model generated if firstMessageMode is set to `assistant-speaks-first-with-model-generated-message`)  - `delete-history`: This deletes the entire conversation history on transfer.    Example:    Pre-transfer:     system: assistant1 system message     assistant: assistant1 first message     user: hey, good morning     assistant: how can i help?     user: i need help with my account     assistant: (destination.message)    Post-transfer:     system: assistant2 system message     assistant: assistant2 first message     user: Yes, please     assistant: how can i help?     user: i need help with my account  - `swap-system-message-in-history-and-remove-transfer-tool-messages`: This replaces the original system message with the new assistant's system message on transfer and removes transfer tool messages from conversation history sent to the LLM.    Example:    Pre-transfer:     system: assistant1 system message     assistant: assistant1 first message     user: hey, good morning     assistant: how can i help?     user: i need help with my account     transfer-tool     transfer-tool-result     assistant: (destination.message)    Post-transfer:     system: assistant2 system message     assistant: assistant1 first message     user: hey, good morning     assistant: how can i help?     user: i need help with my account     assistant: (destination.message)     assistant: assistant2 first message (or model generated if firstMessageMode is set to `assistant-speaks-first-with-model-generated-message`)  @default 'rolling-history'
58#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, ToSchema)]
59pub enum TransferMode {
60    #[serde(rename = "rolling-history")]
61    RollingHistory,
62    #[serde(rename = "swap-system-message-in-history")]
63    SwapSystemMessageInHistory,
64    #[serde(rename = "swap-system-message-in-history-and-remove-transfer-tool-messages")]
65    SwapSystemMessageInHistoryAndRemoveTransferToolMessages,
66    #[serde(rename = "delete-history")]
67    DeleteHistory,
68}
69
70impl Default for TransferMode {
71    fn default() -> TransferMode {
72        Self::RollingHistory
73    }
74}