@@ -89,7 +89,7 @@ impl_builder_methods!(
8989 tool_choice: ToolChoiceType
9090) ;
9191
92- #[ derive( Debug , Serialize , Deserialize , Clone ) ]
92+ #[ derive( Debug , Deserialize , Serialize , Clone ) ]
9393#[ allow( non_camel_case_types) ]
9494pub enum MessageRole {
9595 user,
@@ -116,20 +116,20 @@ impl serde::Serialize for Content {
116116 }
117117}
118118
119- #[ derive( Debug , Serialize , Deserialize , Clone ) ]
119+ #[ derive( Debug , Deserialize , Serialize , Clone ) ]
120120#[ allow( non_camel_case_types) ]
121121pub enum ContentType {
122122 text,
123123 image_url,
124124}
125125
126- #[ derive( Debug , Serialize , Deserialize , Clone ) ]
126+ #[ derive( Debug , Deserialize , Serialize , Clone ) ]
127127#[ allow( non_camel_case_types) ]
128128pub struct ImageUrlType {
129129 pub url : String ,
130130}
131131
132- #[ derive( Debug , Serialize , Deserialize , Clone ) ]
132+ #[ derive( Debug , Deserialize , Serialize , Clone ) ]
133133#[ allow( non_camel_case_types) ]
134134pub struct ImageUrl {
135135 pub r#type : ContentType ,
@@ -139,15 +139,15 @@ pub struct ImageUrl {
139139 pub image_url : Option < ImageUrlType > ,
140140}
141141
142- #[ derive( Debug , Serialize , Deserialize , Clone ) ]
142+ #[ derive( Debug , Deserialize , Serialize , Clone ) ]
143143pub struct ChatCompletionMessage {
144144 pub role : MessageRole ,
145145 pub content : Content ,
146146 #[ serde( skip_serializing_if = "Option::is_none" ) ]
147147 pub name : Option < String > ,
148148}
149149
150- #[ derive( Debug , Serialize , Deserialize ) ]
150+ #[ derive( Debug , Deserialize , Serialize ) ]
151151pub struct ChatCompletionMessageForResponse {
152152 pub role : MessageRole ,
153153 #[ serde( skip_serializing_if = "Option::is_none" ) ]
@@ -177,15 +177,15 @@ pub struct ChatCompletionResponse {
177177 pub system_fingerprint : Option < String > ,
178178}
179179
180- #[ derive( Debug , Serialize , Deserialize , Clone ) ]
180+ #[ derive( Debug , Deserialize , Serialize , Clone ) ]
181181pub struct Function {
182182 pub name : String ,
183183 #[ serde( skip_serializing_if = "Option::is_none" ) ]
184184 pub description : Option < String > ,
185185 pub parameters : FunctionParameters ,
186186}
187187
188- #[ derive( Debug , Serialize , Deserialize , Clone ) ]
188+ #[ derive( Debug , Deserialize , Serialize , Clone ) ]
189189#[ serde( rename_all = "lowercase" ) ]
190190pub enum JSONSchemaType {
191191 Object ,
@@ -196,7 +196,7 @@ pub enum JSONSchemaType {
196196 Boolean ,
197197}
198198
199- #[ derive( Debug , Serialize , Deserialize , Clone , Default ) ]
199+ #[ derive( Debug , Deserialize , Serialize , Clone , Default ) ]
200200pub struct JSONSchemaDefine {
201201 #[ serde( rename = "type" ) ]
202202 pub schema_type : Option < JSONSchemaType > ,
@@ -212,7 +212,7 @@ pub struct JSONSchemaDefine {
212212 pub items : Option < Box < JSONSchemaDefine > > ,
213213}
214214
215- #[ derive( Debug , Serialize , Deserialize , Clone ) ]
215+ #[ derive( Debug , Deserialize , Serialize , Clone ) ]
216216pub struct FunctionParameters {
217217 #[ serde( rename = "type" ) ]
218218 pub schema_type : JSONSchemaType ,
@@ -222,7 +222,7 @@ pub struct FunctionParameters {
222222 pub required : Option < Vec < String > > ,
223223}
224224
225- #[ derive( Debug , Serialize , Deserialize ) ]
225+ #[ derive( Debug , Deserialize , Serialize ) ]
226226#[ allow( non_camel_case_types) ]
227227pub enum FinishReason {
228228 stop,
@@ -232,21 +232,21 @@ pub enum FinishReason {
232232 null,
233233}
234234
235- #[ derive( Debug , Serialize , Deserialize ) ]
235+ #[ derive( Debug , Deserialize , Serialize ) ]
236236#[ allow( non_camel_case_types) ]
237237pub struct FinishDetails {
238238 pub r#type : FinishReason ,
239239 pub stop : String ,
240240}
241241
242- #[ derive( Debug , Serialize , Deserialize , Clone ) ]
242+ #[ derive( Debug , Deserialize , Serialize , Clone ) ]
243243pub struct ToolCall {
244244 pub id : String ,
245245 pub r#type : String ,
246246 pub function : ToolCallFunction ,
247247}
248248
249- #[ derive( Debug , Serialize , Deserialize , Clone ) ]
249+ #[ derive( Debug , Deserialize , Serialize , Clone ) ]
250250pub struct ToolCallFunction {
251251 #[ serde( skip_serializing_if = "Option::is_none" ) ]
252252 pub name : Option < String > ,
@@ -274,13 +274,13 @@ where
274274 }
275275}
276276
277- #[ derive( Debug , Serialize , Deserialize , Clone ) ]
277+ #[ derive( Debug , Deserialize , Serialize , Clone ) ]
278278pub struct Tool {
279279 pub r#type : ToolType ,
280280 pub function : Function ,
281281}
282282
283- #[ derive( Debug , Serialize , Deserialize , Copy , Clone ) ]
283+ #[ derive( Debug , Deserialize , Serialize , Copy , Clone ) ]
284284#[ serde( rename_all = "snake_case" ) ]
285285pub enum ToolType {
286286 Function ,
0 commit comments