vapi_client/models/
anthropic_model.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 AnthropicModel {
16    /// This is the starting state for the conversation.
17    #[serde(rename = "messages", skip_serializing_if = "Option::is_none")]
18    pub messages: Option<Vec<models::OpenAiMessage>>,
19    /// 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.
20    #[serde(rename = "tools", skip_serializing_if = "Option::is_none")]
21    pub tools: Option<Vec<models::AnyscaleModelToolsInner>>,
22    /// 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.
23    #[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<Box<models::AnyscaleModelKnowledgeBase>>,
27    /// This is the ID of the knowledge base the model will use.
28    #[serde(rename = "knowledgeBaseId", skip_serializing_if = "Option::is_none")]
29    pub knowledge_base_id: Option<String>,
30    /// The specific Anthropic/Claude model that will be used.
31    #[serde(rename = "model")]
32    pub model: Model,
33    /// The provider identifier for Anthropic.
34    #[serde(rename = "provider")]
35    pub provider: Provider,
36    /// Optional configuration for Anthropic's thinking feature. Only applicable for claude-3-7-sonnet-20250219 model. If provided, maxTokens must be greater than thinking.budgetTokens.
37    #[serde(rename = "thinking", skip_serializing_if = "Option::is_none")]
38    pub thinking: Option<Box<models::AnthropicThinkingConfig>>,
39    /// This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.
40    #[serde(rename = "temperature", skip_serializing_if = "Option::is_none")]
41    pub temperature: Option<f64>,
42    /// This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250.
43    #[serde(rename = "maxTokens", skip_serializing_if = "Option::is_none")]
44    pub max_tokens: Option<f64>,
45    /// 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
46    #[serde(rename = "emotionRecognitionEnabled", skip_serializing_if = "Option::is_none")]
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 AnthropicModel {
54    pub fn new(model: Model, provider: Provider) -> AnthropicModel {
55        AnthropicModel {
56            messages: None,
57            tools: None,
58            tool_ids: None,
59            knowledge_base: None,
60            knowledge_base_id: None,
61            model,
62            provider,
63            thinking: None,
64            temperature: None,
65            max_tokens: None,
66            emotion_recognition_enabled: None,
67            num_fast_turns: None,
68        }
69    }
70}
71/// The specific Anthropic/Claude model that will be used.
72#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
73pub enum Model {
74    #[serde(rename = "claude-3-opus-20240229")]
75    Claude3Opus20240229,
76    #[serde(rename = "claude-3-sonnet-20240229")]
77    Claude3Sonnet20240229,
78    #[serde(rename = "claude-3-haiku-20240307")]
79    Claude3Haiku20240307,
80    #[serde(rename = "claude-3-5-sonnet-20240620")]
81    Claude35Sonnet20240620,
82    #[serde(rename = "claude-3-5-sonnet-20241022")]
83    Claude35Sonnet20241022,
84    #[serde(rename = "claude-3-5-haiku-20241022")]
85    Claude35Haiku20241022,
86    #[serde(rename = "claude-3-7-sonnet-20250219")]
87    Claude37Sonnet20250219,
88}
89
90impl Default for Model {
91    fn default() -> Model {
92        Self::Claude3Opus20240229
93    }
94}
95/// The provider identifier for Anthropic.
96#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
97pub enum Provider {
98    #[serde(rename = "anthropic")]
99    Anthropic,
100}
101
102impl Default for Provider {
103    fn default() -> Provider {
104        Self::Anthropic
105    }
106}
107