Skip to content

Commit 0b3171c

Browse files
authored
Merge pull request #182 from dongri/add-audio-models
Fix models
2 parents f472d46 + aef88ea commit 0b3171c

File tree

2 files changed

+116
-32
lines changed

2 files changed

+116
-32
lines changed

.github/workflows/rust-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
profile: minimal
2020
toolchain: stable
2121
override: true
22-
components: rustfmt
22+
components: rustfmt, clippy
2323

2424
- name: Check formatting
2525
run: cargo fmt -- --check

src/v1/common.rs

Lines changed: 115 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -31,60 +31,144 @@ macro_rules! impl_builder_methods {
3131
#[derive(Debug, Serialize, Deserialize)]
3232
pub struct EmptyRequestBody {}
3333

34-
// https://platform.openai.com/docs/models/o3
34+
// O-series models
35+
pub const O1: &str = "o1";
36+
pub const O1_2024_12_17: &str = "o1-2024-12-17";
37+
pub const O1_MINI: &str = "o1-mini";
38+
pub const O1_MINI_2024_09_12: &str = "o1-mini-2024-09-12";
39+
pub const O1_PREVIEW: &str = "o1-preview";
40+
pub const O1_PREVIEW_2024_09_12: &str = "o1-preview-2024-09-12";
41+
pub const O1_PRO: &str = "o1-pro";
42+
pub const O1_PRO_2025_03_19: &str = "o1-pro-2025-03-19";
43+
3544
pub const O3: &str = "o3";
3645
pub const O3_2025_04_16: &str = "o3-2025-04-16";
3746
pub const O3_MINI: &str = "o3-mini";
3847
pub const O3_MINI_2025_01_31: &str = "o3-mini-2025-01-31";
3948

40-
// https://platform.openai.com/docs/models#gpt-4-5
41-
pub const GPT4_5_PREVIEW: &str = "gpt-4.5-preview";
42-
pub const GPT4_5_PREVIEW_2025_02_27: &str = "gpt-4.5-preview-2025-02-27";
49+
pub const O4_MINI: &str = "o4-mini";
50+
pub const O4_MINI_2025_04_16: &str = "o4-mini-2025-04-16";
51+
pub const O4_MINI_DEEP_RESEARCH: &str = "o4-mini-deep-research";
52+
pub const O4_MINI_DEEP_RESEARCH_2025_06_26: &str = "o4-mini-deep-research-2025-06-26";
4353

44-
// https://platform.openai.com/docs/models/o1
45-
pub const O1_PREVIEW: &str = "o1-preview";
46-
pub const O1_PREVIEW_2024_09_12: &str = "o1-preview-2024-09-12";
47-
pub const O1_MINI: &str = "o1-mini";
48-
pub const O1_MINI_2024_09_12: &str = "o1-mini-2024-09-12";
54+
// GPT-5 models
55+
pub const GPT5: &str = "gpt-5";
56+
pub const GPT5_2025_08_07: &str = "gpt-5-2025-08-07";
57+
pub const GPT5_CHAT_LATEST: &str = "gpt-5-chat-latest";
58+
pub const GPT5_CODEX: &str = "gpt-5-codex";
59+
pub const GPT5_MINI: &str = "gpt-5-mini";
60+
pub const GPT5_MINI_2025_08_07: &str = "gpt-5-mini-2025-08-07";
61+
pub const GPT5_NANO: &str = "gpt-5-nano";
62+
pub const GPT5_NANO_2025_08_07: &str = "gpt-5-nano-2025-08-07";
4963

50-
// https://platform.openai.com/docs/models/gpt-4o-mini
51-
pub const GPT4_O_MINI: &str = "gpt-4o-mini";
52-
pub const GPT4_O_MINI_2024_07_18: &str = "gpt-4o-mini-2024-07-18";
64+
// GPT-4.1 models
65+
pub const GPT4_1: &str = "gpt-4.1";
66+
pub const GPT4_1_2025_04_14: &str = "gpt-4.1-2025-04-14";
67+
pub const GPT4_1_MINI: &str = "gpt-4.1-mini";
68+
pub const GPT4_1_MINI_2025_04_14: &str = "gpt-4.1-mini-2025-04-14";
69+
pub const GPT4_1_NANO: &str = "gpt-4.1-nano";
70+
pub const GPT4_1_NANO_2025_04_14: &str = "gpt-4.1-nano-2025-04-14";
5371

54-
// https://platform.openai.com/docs/models/gpt-4o
72+
// GPT-4o models
5573
pub const GPT4_O: &str = "gpt-4o";
5674
pub const GPT4_O_2024_05_13: &str = "gpt-4o-2024-05-13";
5775
pub const GPT4_O_2024_08_06: &str = "gpt-4o-2024-08-06";
76+
pub const GPT4_O_2024_11_20: &str = "gpt-4o-2024-11-20";
5877
pub const GPT4_O_LATEST: &str = "chatgpt-4o-latest";
5978

60-
// https://platform.openai.com/docs/models/gpt-3-5
61-
pub const GPT3_5_TURBO_1106: &str = "gpt-3.5-turbo-1106";
62-
pub const GPT3_5_TURBO: &str = "gpt-3.5-turbo";
63-
pub const GPT3_5_TURBO_16K: &str = "gpt-3.5-turbo-16k";
64-
pub const GPT3_5_TURBO_INSTRUCT: &str = "gpt-3.5-turbo-instruct";
65-
// - legacy
66-
pub const GPT3_5_TURBO_0613: &str = "gpt-3.5-turbo-0613";
67-
pub const GPT3_5_TURBO_16K_0613: &str = "gpt-3.5-turbo-16k-0613";
68-
pub const GPT3_5_TURBO_0301: &str = "gpt-3.5-turbo-0301";
79+
pub const GPT4_O_MINI: &str = "gpt-4o-mini";
80+
pub const GPT4_O_MINI_2024_07_18: &str = "gpt-4o-mini-2024-07-18";
6981

70-
// https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo
71-
pub const GPT4_0125_PREVIEW: &str = "gpt-4-0125-preview";
72-
pub const GPT4_TURBO_PREVIEW: &str = "gpt-4-turbo-preview";
73-
pub const GPT4_1106_PREVIEW: &str = "gpt-4-1106-preview";
74-
pub const GPT4_VISION_PREVIEW: &str = "gpt-4-vision-preview";
82+
// GPT-4o search models
83+
pub const GPT4_O_SEARCH_PREVIEW: &str = "gpt-4o-search-preview";
84+
pub const GPT4_O_SEARCH_PREVIEW_2025_03_11: &str = "gpt-4o-search-preview-2025-03-11";
85+
pub const GPT4_O_MINI_SEARCH_PREVIEW: &str = "gpt-4o-mini-search-preview";
86+
pub const GPT4_O_MINI_SEARCH_PREVIEW_2025_03_11: &str = "gpt-4o-mini-search-preview-2025-03-11";
87+
88+
// GPT-4o realtime models
89+
pub const GPT4_O_REALTIME_PREVIEW: &str = "gpt-4o-realtime-preview";
90+
pub const GPT4_O_REALTIME_PREVIEW_2024_10_01: &str = "gpt-4o-realtime-preview-2024-10-01";
91+
pub const GPT4_O_REALTIME_PREVIEW_2024_12_17: &str = "gpt-4o-realtime-preview-2024-12-17";
92+
pub const GPT4_O_REALTIME_PREVIEW_2025_06_03: &str = "gpt-4o-realtime-preview-2025-06-03";
93+
pub const GPT4_O_MINI_REALTIME_PREVIEW: &str = "gpt-4o-mini-realtime-preview";
94+
pub const GPT4_O_MINI_REALTIME_PREVIEW_2024_12_17: &str = "gpt-4o-mini-realtime-preview-2024-12-17";
95+
96+
// GPT-4o audio models
97+
pub const GPT4_O_AUDIO_PREVIEW: &str = "gpt-4o-audio-preview";
98+
pub const GPT4_O_AUDIO_PREVIEW_2024_10_01: &str = "gpt-4o-audio-preview-2024-10-01";
99+
pub const GPT4_O_AUDIO_PREVIEW_2024_12_17: &str = "gpt-4o-audio-preview-2024-12-17";
100+
pub const GPT4_O_AUDIO_PREVIEW_2025_06_03: &str = "gpt-4o-audio-preview-2025-06-03";
101+
pub const GPT4_O_MINI_AUDIO_PREVIEW: &str = "gpt-4o-mini-audio-preview";
102+
pub const GPT4_O_MINI_AUDIO_PREVIEW_2024_12_17: &str = "gpt-4o-mini-audio-preview-2024-12-17";
103+
104+
// GPT-4o transcription models
105+
pub const GPT4_O_TRANSCRIBE: &str = "gpt-4o-transcribe";
106+
pub const GPT4_O_MINI_TRANSCRIBE: &str = "gpt-4o-mini-transcribe";
107+
108+
// GPT-4 and GPT-4 Turbo models
75109
pub const GPT4: &str = "gpt-4";
76-
pub const GPT4_32K: &str = "gpt-4-32k";
77110
pub const GPT4_0613: &str = "gpt-4-0613";
111+
pub const GPT4_32K: &str = "gpt-4-32k";
78112
pub const GPT4_32K_0613: &str = "gpt-4-32k-0613";
79-
// - legacy
80113
pub const GPT4_0314: &str = "gpt-4-0314";
81114
pub const GPT4_32K_0314: &str = "gpt-4-32k-0314";
82115

83-
// https://platform.openai.com/docs/api-reference/images/object
116+
pub const GPT4_TURBO: &str = "gpt-4-turbo";
117+
pub const GPT4_TURBO_2024_04_09: &str = "gpt-4-turbo-2024-04-09";
118+
pub const GPT4_TURBO_PREVIEW: &str = "gpt-4-turbo-preview";
119+
pub const GPT4_0125_PREVIEW: &str = "gpt-4-0125-preview";
120+
pub const GPT4_1106_PREVIEW: &str = "gpt-4-1106-preview";
121+
pub const GPT4_VISION_PREVIEW: &str = "gpt-4-vision-preview";
122+
123+
// GPT-3.5 Turbo models
124+
pub const GPT3_5_TURBO: &str = "gpt-3.5-turbo";
125+
pub const GPT3_5_TURBO_0125: &str = "gpt-3.5-turbo-0125";
126+
pub const GPT3_5_TURBO_1106: &str = "gpt-3.5-turbo-1106";
127+
pub const GPT3_5_TURBO_16K: &str = "gpt-3.5-turbo-16k";
128+
pub const GPT3_5_TURBO_0613: &str = "gpt-3.5-turbo-0613";
129+
pub const GPT3_5_TURBO_16K_0613: &str = "gpt-3.5-turbo-16k-0613";
130+
pub const GPT3_5_TURBO_0301: &str = "gpt-3.5-turbo-0301";
131+
132+
pub const GPT3_5_TURBO_INSTRUCT: &str = "gpt-3.5-turbo-instruct";
133+
pub const GPT3_5_TURBO_INSTRUCT_0914: &str = "gpt-3.5-turbo-instruct-0914";
134+
135+
// Audio models
136+
pub const GPT_AUDIO: &str = "gpt-audio";
137+
pub const GPT_AUDIO_2025_08_28: &str = "gpt-audio-2025-08-28";
138+
pub const GPT_REALTIME: &str = "gpt-realtime";
139+
pub const GPT_REALTIME_2025_08_28: &str = "gpt-realtime-2025-08-28";
140+
141+
// Text-to-Speech models
142+
pub const TTS_1: &str = "tts-1";
143+
pub const TTS_1_HD: &str = "tts-1-hd";
144+
pub const TTS_1_1106: &str = "tts-1-1106";
145+
pub const TTS_1_HD_1106: &str = "tts-1-hd-1106";
146+
pub const GPT4_O_MINI_TTS: &str = "gpt-4o-mini-tts";
147+
148+
// Speech-to-Text models
149+
pub const WHISPER_1: &str = "whisper-1";
150+
151+
// Image generation models
84152
pub const DALL_E_2: &str = "dall-e-2";
85153
pub const DALL_E_3: &str = "dall-e-3";
154+
pub const GPT_IMAGE_1: &str = "gpt-image-1";
86155

87-
// https://platform.openai.com/docs/guides/embeddings/embedding-models
156+
// Embedding models
88157
pub const TEXT_EMBEDDING_3_SMALL: &str = "text-embedding-3-small";
89158
pub const TEXT_EMBEDDING_3_LARGE: &str = "text-embedding-3-large";
90159
pub const TEXT_EMBEDDING_ADA_002: &str = "text-embedding-ada-002";
160+
161+
// Moderation models
162+
pub const OMNI_MODERATION_LATEST: &str = "omni-moderation-latest";
163+
pub const OMNI_MODERATION_2024_09_26: &str = "omni-moderation-2024-09-26";
164+
165+
// Legacy models
166+
pub const DAVINCI_002: &str = "davinci-002";
167+
pub const BABBAGE_002: &str = "babbage-002";
168+
169+
// Code models
170+
pub const CODEX_MINI_LATEST: &str = "codex-mini-latest";
171+
172+
// Preview models (GPT-4.5)
173+
pub const GPT4_5_PREVIEW: &str = "gpt-4.5-preview";
174+
pub const GPT4_5_PREVIEW_2025_02_27: &str = "gpt-4.5-preview-2025-02-27";

0 commit comments

Comments
 (0)