semantic_query/clients/claude/
models.rs1#[derive(Debug, Clone, PartialEq)]
2pub enum ClaudeModel {
3 Opus4,
5 Sonnet4,
6
7 Sonnet37,
9
10 Haiku35,
12 Sonnet35V2,
13 Sonnet35,
14
15 Opus3,
17 Sonnet3,
18 Haiku3,
19}
20
21impl Default for ClaudeModel {
22 fn default() -> Self {
23 Self::Haiku35
24 }
25}
26
27impl ClaudeModel {
28 pub fn anthropic_model_id(&self) -> &'static str {
29 match self {
30 Self::Opus4 => "claude-opus-4-20250514",
31 Self::Sonnet4 => "claude-sonnet-4-20250514",
32 Self::Sonnet37 => "claude-3-7-sonnet-20250219",
33 Self::Haiku35 => "claude-3-5-haiku-20241022",
34 Self::Sonnet35V2 => "claude-3-5-sonnet-20241022",
35 Self::Sonnet35 => "claude-3-5-sonnet-20240620",
36 Self::Opus3 => "claude-3-opus-20240229",
37 Self::Sonnet3 => "claude-3-sonnet-20240229",
38 Self::Haiku3 => "claude-3-haiku-20240307",
39 }
40 }
41
42 pub fn bedrock_model_id(&self) -> &'static str {
43 match self {
44 Self::Opus4 => "anthropic.claude-opus-4-20250514-v1:0",
45 Self::Sonnet4 => "anthropic.claude-sonnet-4-20250514-v1:0",
46 Self::Sonnet37 => "anthropic.claude-3-7-sonnet-20250219-v1:0",
47 Self::Haiku35 => "anthropic.claude-3-5-haiku-20241022-v1:0",
48 Self::Sonnet35V2 => "anthropic.claude-3-5-sonnet-20241022-v2:0",
49 Self::Sonnet35 => "anthropic.claude-3-5-sonnet-20240620-v1:0",
50 Self::Opus3 => "anthropic.claude-3-opus-20240229-v1:0",
51 Self::Sonnet3 => "anthropic.claude-3-sonnet-20240229-v1:0",
52 Self::Haiku3 => "anthropic.claude-3-haiku-20240307-v1:0",
53 }
54 }
55
56 pub fn vertex_model_id(&self) -> &'static str {
57 match self {
58 Self::Opus4 => "claude-opus-4@20250514",
59 Self::Sonnet4 => "claude-sonnet-4@20250514",
60 Self::Sonnet37 => "claude-3-7-sonnet@20250219",
61 Self::Haiku35 => "claude-3-5-haiku@20241022",
62 Self::Sonnet35V2 => "claude-3-5-sonnet-v2@20241022",
63 Self::Sonnet35 => "claude-3-5-sonnet@20240620",
64 Self::Opus3 => "claude-3-opus@20240229",
65 Self::Sonnet3 => "claude-3-sonnet@20240229",
66 Self::Haiku3 => "claude-3-haiku@20240307",
67 }
68 }
69
70 pub fn model_id_for_provider(&self, provider: &super::config::Provider) -> &'static str {
71 match provider {
72 super::config::Provider::Anthropic => self.anthropic_model_id(),
73 super::config::Provider::AwsBedrock => self.bedrock_model_id(),
74 super::config::Provider::GcpVertex => self.vertex_model_id(),
75 }
76 }
77
78 pub fn display_name(&self) -> &'static str {
79 match self {
80 Self::Opus4 => "Claude 4 Opus",
81 Self::Sonnet4 => "Claude 4 Sonnet",
82 Self::Sonnet37 => "Claude 3.7 Sonnet",
83 Self::Haiku35 => "Claude 3.5 Haiku",
84 Self::Sonnet35V2 => "Claude 3.5 Sonnet v2",
85 Self::Sonnet35 => "Claude 3.5 Sonnet",
86 Self::Opus3 => "Claude 3 Opus",
87 Self::Sonnet3 => "Claude 3 Sonnet",
88 Self::Haiku3 => "Claude 3 Haiku",
89 }
90 }
91}