vapi_client/models/
client_message_conversation_update.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 ClientMessageConversationUpdate {
17    /// This is the type of the message. \"conversation-update\" is sent when an update is committed to the conversation history.
18    #[serde(rename = "type")]
19    pub r#type: Type,
20    /// This is the most up-to-date conversation history at the time the message is sent.
21    #[serde(rename = "messages", skip_serializing_if = "Option::is_none")]
22    pub messages: Option<Vec<models::ArtifactMessagesInner>>,
23    /// This is the most up-to-date conversation history at the time the message is sent, formatted for OpenAI.
24    #[serde(rename = "messagesOpenAIFormatted")]
25    pub messages_open_ai_formatted: Vec<models::OpenAiMessage>,
26}
27
28impl ClientMessageConversationUpdate {
29    pub fn new(
30        r#type: Type,
31        messages_open_ai_formatted: Vec<models::OpenAiMessage>,
32    ) -> ClientMessageConversationUpdate {
33        ClientMessageConversationUpdate {
34            r#type,
35            messages: None,
36            messages_open_ai_formatted,
37        }
38    }
39}
40/// This is the type of the message. \"conversation-update\" is sent when an update is committed to the conversation history.
41#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
42pub enum Type {
43    #[serde(rename = "conversation-update")]
44    ConversationUpdate,
45}
46
47impl Default for Type {
48    fn default() -> Type {
49        Self::ConversationUpdate
50    }
51}