vapi_client/models/
client_message_transcript.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 ClientMessageTranscript {
16    /// This is the type of the message. \"transcript\" is sent as transcriber outputs partial or final transcript.
17    #[serde(rename = "type")]
18    pub r#type: Type,
19    /// This is the role for which the transcript is for.
20    #[serde(rename = "role")]
21    pub role: Role,
22    /// This is the type of the transcript.
23    #[serde(rename = "transcriptType")]
24    pub transcript_type: TranscriptType,
25    /// This is the transcript content.
26    #[serde(rename = "transcript")]
27    pub transcript: String,
28}
29
30impl ClientMessageTranscript {
31    pub fn new(r#type: Type, role: Role, transcript_type: TranscriptType, transcript: String) -> ClientMessageTranscript {
32        ClientMessageTranscript {
33            r#type,
34            role,
35            transcript_type,
36            transcript,
37        }
38    }
39}
40/// This is the type of the message. \"transcript\" is sent as transcriber outputs partial or final transcript.
41#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
42pub enum Type {
43    #[serde(rename = "transcript")]
44    Transcript,
45    #[serde(rename = "transcript[transcriptType=\"final\"]")]
46    TranscriptLeftSquareBracketTranscriptTypeEqualDoubleQuoteFinalDoubleQuoteRightSquareBracket,
47}
48
49impl Default for Type {
50    fn default() -> Type {
51        Self::Transcript
52    }
53}
54/// This is the role for which the transcript is for.
55#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
56pub enum Role {
57    #[serde(rename = "assistant")]
58    Assistant,
59    #[serde(rename = "user")]
60    User,
61}
62
63impl Default for Role {
64    fn default() -> Role {
65        Self::Assistant
66    }
67}
68/// This is the type of the transcript.
69#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
70pub enum TranscriptType {
71    #[serde(rename = "partial")]
72    Partial,
73    #[serde(rename = "final")]
74    Final,
75}
76
77impl Default for TranscriptType {
78    fn default() -> TranscriptType {
79        Self::Partial
80    }
81}
82