vapi_client/models/
vapi_model.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct VapiModel {
16 #[serde(rename = "messages", skip_serializing_if = "Option::is_none")]
18 pub messages: Option<Vec<models::OpenAiMessage>>,
19 #[serde(rename = "tools", skip_serializing_if = "Option::is_none")]
21 pub tools: Option<Vec<models::AnyscaleModelToolsInner>>,
22 #[serde(rename = "toolIds", skip_serializing_if = "Option::is_none")]
24 pub tool_ids: Option<Vec<String>>,
25 #[serde(rename = "knowledgeBase", skip_serializing_if = "Option::is_none")]
26 pub knowledge_base: Option<models::CreateCustomKnowledgeBaseDto>,
27 #[serde(rename = "knowledgeBaseId", skip_serializing_if = "Option::is_none")]
29 pub knowledge_base_id: Option<String>,
30 #[serde(rename = "provider")]
31 pub provider: ProviderTrue,
32 #[serde(rename = "workflowId", skip_serializing_if = "Option::is_none")]
34 pub workflow_id: Option<String>,
35 #[serde(rename = "workflow", skip_serializing_if = "Option::is_none")]
37 pub workflow: Option<models::WorkflowUserEditable>,
38 #[serde(rename = "model")]
40 pub model: String,
41 #[serde(rename = "temperature", skip_serializing_if = "Option::is_none")]
43 pub temperature: Option<f64>,
44 #[serde(rename = "maxTokens", skip_serializing_if = "Option::is_none")]
46 pub max_tokens: Option<f64>,
47 #[serde(
49 rename = "emotionRecognitionEnabled",
50 skip_serializing_if = "Option::is_none"
51 )]
52 pub emotion_recognition_enabled: Option<bool>,
53 #[serde(rename = "numFastTurns", skip_serializing_if = "Option::is_none")]
55 pub num_fast_turns: Option<f64>,
56}
57
58impl VapiModel {
59 pub fn new(provider: ProviderTrue, model: String) -> VapiModel {
60 VapiModel {
61 messages: None,
62 tools: None,
63 tool_ids: None,
64 knowledge_base: None,
65 knowledge_base_id: None,
66 provider,
67 workflow_id: None,
68 workflow: None,
69 model,
70 temperature: None,
71 max_tokens: None,
72 emotion_recognition_enabled: None,
73 num_fast_turns: None,
74 }
75 }
76}
77#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
79pub enum ProviderTrue {
80 #[serde(rename = "vapi")]
81 Vapi,
82}
83
84impl Default for ProviderTrue {
85 fn default() -> ProviderTrue {
86 Self::Vapi
87 }
88}