1use super::traits::*;
63use crate::{
64 define_model_type, impl_message_binding, impl_model_markers,
65 model::chat_message_types::{TextMessage, VisionMessage, VoiceMessage},
66};
67
68define_model_type!(GLM5_2, "glm-5.2");
75impl_message_binding!(GLM5_2, TextMessage);
76impl_model_markers!(GLM5_2: Chat, AsyncChat, ThinkEnable, ReasoningEffortEnable);
77impl ToolStreamEnable for GLM5_2 {}
78
79define_model_type!(GLM5_1, "glm-5.1");
80impl_message_binding!(GLM5_1, TextMessage);
81impl_model_markers!(GLM5_1: Chat, AsyncChat, ThinkEnable, ToolStreamEnable);
82
83define_model_type!(
84 #[allow(non_camel_case_types)]
85 GLM5_turbo,
86 "glm-5-turbo"
87);
88impl_message_binding!(GLM5_turbo, TextMessage);
89impl_model_markers!(GLM5_turbo: Chat, AsyncChat, ThinkEnable, ToolStreamEnable);
90
91define_model_type!(GLM5, "glm-5");
92impl_message_binding!(GLM5, TextMessage);
93impl_model_markers!(GLM5: Chat, AsyncChat, ThinkEnable, ToolStreamEnable);
94
95define_model_type!(
100 #[allow(non_camel_case_types)]
101 GLM5V_turbo,
102 "glm-5v-turbo"
103);
104impl_message_binding!(GLM5V_turbo, VisionMessage);
105impl_model_markers!(GLM5V_turbo: Chat, AsyncChat, ThinkEnable);
106
107define_model_type!(GLM4_7, "glm-4.7");
108impl_message_binding!(GLM4_7, TextMessage);
109impl_model_markers!(GLM4_7: Chat, AsyncChat, ThinkEnable, ToolStreamEnable);
110
111define_model_type!(
112 #[allow(non_camel_case_types)]
113 GLM4_7_flash,
114 "glm-4.7-flash"
115);
116impl_message_binding!(GLM4_7_flash, TextMessage);
117impl_model_markers!(GLM4_7_flash: Chat, AsyncChat, ThinkEnable);
118
119define_model_type!(
120 #[allow(non_camel_case_types)]
121 GLM4_7_flashx,
122 "glm-4.7-flashx"
123);
124impl_message_binding!(GLM4_7_flashx, TextMessage);
125impl_model_markers!(GLM4_7_flashx: Chat, AsyncChat, ThinkEnable);
126
127define_model_type!(GLM4_6, "glm-4.6");
128impl_message_binding!(GLM4_6, TextMessage);
129impl_model_markers!(GLM4_6: Chat, AsyncChat, ThinkEnable);
130impl ToolStreamEnable for GLM4_6 {}
131
132define_model_type!(GLM4_5, "glm-4.5");
133impl_message_binding!(GLM4_5, TextMessage);
134impl_model_markers!(GLM4_5: Chat, AsyncChat, ThinkEnable);
135
136define_model_type!(
137 #[allow(non_camel_case_types)]
138 GLM4_5_x,
139 "glm-4.5-X"
140);
141impl_message_binding!(GLM4_5_x, TextMessage);
142impl_model_markers!(GLM4_5_x: Chat, AsyncChat, ThinkEnable);
143
144define_model_type!(
145 #[allow(non_camel_case_types)]
146 GLM4_5_flash,
147 "glm-4.5-flash"
148);
149impl_message_binding!(GLM4_5_flash, TextMessage);
150impl_model_markers!(GLM4_5_flash: Chat, AsyncChat, ThinkEnable);
151
152define_model_type!(
153 #[allow(non_camel_case_types)]
154 GLM4_5_air,
155 "glm-4.5-air"
156);
157impl_message_binding!(GLM4_5_air, TextMessage);
158impl_model_markers!(GLM4_5_air: Chat, AsyncChat, ThinkEnable);
159
160define_model_type!(
161 #[allow(non_camel_case_types)]
162 GLM4_5_airx,
163 "glm-4.5-airx"
164);
165impl_message_binding!(GLM4_5_airx, TextMessage);
166impl_model_markers!(GLM4_5_airx: Chat, AsyncChat, ThinkEnable);
167
168define_model_type!(
173 #[allow(non_camel_case_types)]
174 autoglm_phone,
175 "autoglm-phone"
176);
177impl_message_binding!(autoglm_phone, VisionMessage);
178impl_model_markers!(autoglm_phone: Chat, AsyncChat);
179
180define_model_type!(
181 #[allow(non_camel_case_types)]
182 GLM4_6v,
183 "glm-4.6v"
184);
185impl_message_binding!(GLM4_6v, VisionMessage);
186impl_model_markers!(GLM4_6v: Chat, AsyncChat);
187
188define_model_type!(
189 #[allow(non_camel_case_types)]
190 GLM4_6v_flash,
191 "glm-4.6v-flash"
192);
193impl_message_binding!(GLM4_6v_flash, VisionMessage);
194impl_model_markers!(GLM4_6v_flash: Chat, AsyncChat);
195
196define_model_type!(
197 #[allow(non_camel_case_types)]
198 GLM4_6v_flashx,
199 "glm-4.6v-flashx"
200);
201impl_message_binding!(GLM4_6v_flashx, VisionMessage);
202impl_model_markers!(GLM4_6v_flashx: Chat, AsyncChat);
203
204define_model_type!(
205 #[allow(non_camel_case_types)]
206 GLM4_5v,
207 "glm-4.5v"
208);
209impl_message_binding!(GLM4_5v, VisionMessage);
210impl_model_markers!(GLM4_5v: Chat, AsyncChat);
211
212define_model_type!(
217 #[allow(non_camel_case_types)]
218 GLM4_voice,
219 "glm-4-voice"
220);
221impl_message_binding!(GLM4_voice, VoiceMessage);
222impl_model_markers!(GLM4_voice: Chat, AsyncChat);
223
224define_model_type!(
232 #[allow(non_camel_case_types)]
233 GLM_realtime,
234 "glm-realtime"
235);
236impl_model_markers!(GLM_realtime: Chat, AsyncChat);
237
238define_model_type!(
240 #[allow(non_camel_case_types)]
241 GLM4_5_voice,
242 "glm-4.5-voice"
243);
244impl_model_markers!(GLM4_5_voice: Chat, AsyncChat);
245
246#[cfg(test)]
247mod tests {
248 use super::*;
249
250 #[test]
251 fn official_chat_model_names_match_snapshot() {
252 let models = [
253 String::from(GLM5_2 {}),
254 String::from(GLM5_1 {}),
255 String::from(GLM5_turbo {}),
256 String::from(GLM5 {}),
257 String::from(GLM4_7 {}),
258 String::from(GLM4_6 {}),
259 String::from(GLM4_5_air {}),
260 String::from(GLM4_5_airx {}),
261 String::from(GLM4_5_flash {}),
262 ];
263
264 assert_eq!(
265 models,
266 [
267 "glm-5.2",
268 "glm-5.1",
269 "glm-5-turbo",
270 "glm-5",
271 "glm-4.7",
272 "glm-4.6",
273 "glm-4.5-air",
274 "glm-4.5-airx",
275 "glm-4.5-flash",
276 ]
277 );
278 }
279}