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};
12
13use crate::models;
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TransferDestinationAssistant {
17 #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
18 pub message: Option<models::TransferDestinationAssistantMessage>,
19 #[serde(rename = "type")]
20 pub r#type: Type,
21 /// 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'
22 #[serde(rename = "transferMode", skip_serializing_if = "Option::is_none")]
23 pub transfer_mode: Option<TransferMode>,
24 /// This is the assistant to transfer the call to.
25 #[serde(rename = "assistantName")]
26 pub assistant_name: String,
27 /// This is the description of the destination, used by the AI to choose when and how to transfer the call.
28 #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
29 pub description: Option<String>,
30}
31
32impl TransferDestinationAssistant {
33 pub fn new(r#type: Type, assistant_name: String) -> TransferDestinationAssistant {
34 TransferDestinationAssistant {
35 message: None,
36 r#type,
37 transfer_mode: None,
38 assistant_name,
39 description: None,
40 }
41 }
42}
43///
44#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
45pub enum Type {
46 #[serde(rename = "assistant")]
47 Assistant,
48}
49
50impl Default for Type {
51 fn default() -> Type {
52 Self::Assistant
53 }
54}
55/// 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'
56#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
57pub enum TransferMode {
58 #[serde(rename = "rolling-history")]
59 RollingHistory,
60 #[serde(rename = "swap-system-message-in-history")]
61 SwapSystemMessageInHistory,
62 #[serde(rename = "swap-system-message-in-history-and-remove-transfer-tool-messages")]
63 SwapSystemMessageInHistoryAndRemoveTransferToolMessages,
64 #[serde(rename = "delete-history")]
65 DeleteHistory,
66}
67
68impl Default for TransferMode {
69 fn default() -> TransferMode {
70 Self::RollingHistory
71 }
72}