vapi_client/models/
client_message_conversation_update.rs

1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ClientMessageConversationUpdate {
16    /// This is the type of the message. \"conversation-update\" is sent when an update is committed to the conversation history.
17    #[serde(rename = "type")]
18    pub r#type: Type,
19    /// This is the most up-to-date conversation history at the time the message is sent.
20    #[serde(rename = "messages", skip_serializing_if = "Option::is_none")]
21    pub messages: Option<Vec<models::ArtifactMessagesInner>>,
22    /// This is the most up-to-date conversation history at the time the message is sent, formatted for OpenAI.
23    #[serde(rename = "messagesOpenAIFormatted")]
24    pub messages_open_ai_formatted: Vec<models::OpenAiMessage>,
25}
26
27impl ClientMessageConversationUpdate {
28    pub fn new(r#type: Type, messages_open_ai_formatted: Vec<models::OpenAiMessage>) -> ClientMessageConversationUpdate {
29        ClientMessageConversationUpdate {
30            r#type,
31            messages: None,
32            messages_open_ai_formatted,
33        }
34    }
35}
36/// This is the type of the message. \"conversation-update\" is sent when an update is committed to the conversation history.
37#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
38pub enum Type {
39    #[serde(rename = "conversation-update")]
40    ConversationUpdate,
41}
42
43impl Default for Type {
44    fn default() -> Type {
45        Self::ConversationUpdate
46    }
47}
48