vapi_client/models/
groq_model.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 GroqModel {
17    /// This is the starting state for the conversation.
18    #[serde(rename = "messages", skip_serializing_if = "Option::is_none")]
19    pub messages: Option<Vec<models::OpenAiMessage>>,
20    /// These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`.  Both `tools` and `toolIds` can be used together.
21    #[serde(rename = "tools", skip_serializing_if = "Option::is_none")]
22    pub tools: Option<Vec<models::AnyscaleModelToolsInner>>,
23    /// These are the tools that the assistant can use during the call. To use transient tools, use `tools`.  Both `tools` and `toolIds` can be used together.
24    #[serde(rename = "toolIds", skip_serializing_if = "Option::is_none")]
25    pub tool_ids: Option<Vec<String>>,
26    #[serde(rename = "knowledgeBase", skip_serializing_if = "Option::is_none")]
27    pub knowledge_base: Option<models::AnyscaleModelKnowledgeBase>,
28    /// This is the ID of the knowledge base the model will use.
29    #[serde(rename = "knowledgeBaseId", skip_serializing_if = "Option::is_none")]
30    pub knowledge_base_id: Option<String>,
31    /// This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b
32    #[serde(rename = "model")]
33    pub model: Model,
34    #[serde(rename = "provider")]
35    pub provider: Provider,
36    /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.
37    #[serde(rename = "temperature", skip_serializing_if = "Option::is_none")]
38    pub temperature: Option<f64>,
39    /// This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250.
40    #[serde(rename = "maxTokens", skip_serializing_if = "Option::is_none")]
41    pub max_tokens: Option<f64>,
42    /// This determines whether we detect user's emotion while they speak and send it as an additional info to model.  Default `false` because the model is usually are good at understanding the user's emotion from text.  @default false
43    #[serde(
44        rename = "emotionRecognitionEnabled",
45        skip_serializing_if = "Option::is_none"
46    )]
47    pub emotion_recognition_enabled: Option<bool>,
48    /// This sets how many turns at the start of the conversation to use a smaller, faster model from the same provider before switching to the primary model. Example, gpt-3.5-turbo if provider is openai.  Default is 0.  @default 0
49    #[serde(rename = "numFastTurns", skip_serializing_if = "Option::is_none")]
50    pub num_fast_turns: Option<f64>,
51}
52
53impl GroqModel {
54    pub fn new(model: Model, provider: Provider) -> GroqModel {
55        GroqModel {
56            messages: None,
57            tools: None,
58            tool_ids: None,
59            knowledge_base: None,
60            knowledge_base_id: None,
61            model,
62            provider,
63            temperature: None,
64            max_tokens: None,
65            emotion_recognition_enabled: None,
66            num_fast_turns: None,
67        }
68    }
69}
70/// This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b
71#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
72pub enum Model {
73    #[serde(rename = "deepseek-r1-distill-llama-70b")]
74    DeepseekR1DistillLlama70b,
75    #[serde(rename = "llama-3.3-70b-versatile")]
76    Llama3Period370bVersatile,
77    #[serde(rename = "llama-3.1-405b-reasoning")]
78    Llama3Period1405bReasoning,
79    #[serde(rename = "llama-3.1-70b-versatile")]
80    Llama3Period170bVersatile,
81    #[serde(rename = "llama-3.1-8b-instant")]
82    Llama3Period18bInstant,
83    #[serde(rename = "mixtral-8x7b-32768")]
84    Mixtral8x7b32768,
85    #[serde(rename = "llama3-8b-8192")]
86    Llama38b8192,
87    #[serde(rename = "llama3-70b-8192")]
88    Llama370b8192,
89    #[serde(rename = "gemma2-9b-it")]
90    Gemma29bIt,
91}
92
93impl Default for Model {
94    fn default() -> Model {
95        Self::DeepseekR1DistillLlama70b
96    }
97}
98///
99#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
100pub enum Provider {
101    #[serde(rename = "groq")]
102    Groq,
103}
104
105impl Default for Provider {
106    fn default() -> Provider {
107        Self::Groq
108    }
109}