vapi_client/models/
client_message_transfer_update_destination.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/// ClientMessageTransferUpdateDestination : This is the destination of the transfer.
18/// This is the destination of the transfer.
19#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, ToSchema)]
20#[serde(untagged)]
21pub enum ClientMessageTransferUpdateDestination {
22    TransferDestinationAssistant(models::TransferDestinationAssistant),
23    TransferDestinationStep(models::TransferDestinationStep),
24    TransferDestinationNumber(models::TransferDestinationNumber),
25    TransferDestinationSip(models::TransferDestinationSip),
26}
27
28impl Default for ClientMessageTransferUpdateDestination {
29    fn default() -> Self {
30        Self::TransferDestinationAssistant(Default::default())
31    }
32}
33///
34#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, ToSchema)]
35pub enum Type {
36    #[serde(rename = "assistant")]
37    Assistant,
38    #[serde(rename = "step")]
39    Step,
40    #[serde(rename = "number")]
41    Number,
42    #[serde(rename = "sip")]
43    Sip,
44}
45
46impl Default for Type {
47    fn default() -> Type {
48        Self::Assistant
49    }
50}
51/// 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'
52#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, ToSchema)]
53pub enum TransferMode {
54    #[serde(rename = "rolling-history")]
55    RollingHistory,
56    #[serde(rename = "swap-system-message-in-history")]
57    SwapSystemMessageInHistory,
58    #[serde(rename = "swap-system-message-in-history-and-remove-transfer-tool-messages")]
59    SwapSystemMessageInHistoryAndRemoveTransferToolMessages,
60    #[serde(rename = "delete-history")]
61    DeleteHistory,
62}
63
64impl Default for TransferMode {
65    fn default() -> TransferMode {
66        Self::RollingHistory
67    }
68}