@@ -41,8 +41,10 @@ pub struct ChatkitWorkflow {
4141 /// Identifier of the workflow backing the session.
4242 pub id : String ,
4343 /// Specific workflow version used for the session. Defaults to null when using the latest deployment.
44+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
4445 pub version : Option < String > ,
4546 /// State variable key-value pairs applied when invoking the workflow. Defaults to null when no overrides were provided.
47+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
4648 pub state_variables : Option < HashMap < String , serde_json:: Value > > ,
4749 /// Tracing settings applied to the workflow.
4850 pub tracing : ChatkitWorkflowTracing ,
@@ -95,8 +97,10 @@ pub struct ChatSessionFileUpload {
9597 /// Indicates if uploads are enabled for the session.
9698 pub enabled : bool ,
9799 /// Maximum upload size in megabytes.
100+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
98101 pub max_file_size : Option < i32 > ,
99102 /// Maximum number of uploads allowed during the session.
103+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
100104 pub max_files : Option < i32 > ,
101105}
102106
@@ -106,14 +110,15 @@ pub struct ChatSessionHistory {
106110 /// Indicates if chat history is persisted for the session.
107111 pub enabled : bool ,
108112 /// Number of prior threads surfaced in history views. Defaults to null when all history is retained.
113+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
109114 pub recent_threads : Option < i32 > ,
110115}
111116
112117/// Parameters for provisioning a new ChatKit session.
113- #[ derive( Clone , Serialize , Debug , Deserialize , Builder , PartialEq ) ]
118+ #[ derive( Clone , Serialize , Debug , Deserialize , Builder , PartialEq , Default ) ]
114119#[ builder( name = "CreateChatSessionRequestArgs" ) ]
115120#[ builder( pattern = "mutable" ) ]
116- #[ builder( setter( into, strip_option) ) ]
121+ #[ builder( setter( into, strip_option) , default ) ]
117122#[ builder( derive( Debug ) ) ]
118123#[ builder( build_fn( error = "OpenAIError" ) ) ]
119124pub struct CreateChatSessionBody {
@@ -133,10 +138,10 @@ pub struct CreateChatSessionBody {
133138}
134139
135140/// Workflow reference and overrides applied to the chat session.
136- #[ derive( Clone , Serialize , Debug , Deserialize , Builder , PartialEq ) ]
141+ #[ derive( Clone , Serialize , Debug , Deserialize , Builder , PartialEq , Default ) ]
137142#[ builder( name = "WorkflowParamArgs" ) ]
138143#[ builder( pattern = "mutable" ) ]
139- #[ builder( setter( into, strip_option) ) ]
144+ #[ builder( setter( into, strip_option) , default ) ]
140145#[ builder( derive( Debug ) ) ]
141146#[ builder( build_fn( error = "OpenAIError" ) ) ]
142147pub struct WorkflowParam {
@@ -167,10 +172,10 @@ pub struct WorkflowTracingParam {
167172}
168173
169174/// Controls when the session expires relative to an anchor timestamp.
170- #[ derive( Clone , Serialize , Debug , Deserialize , Builder , PartialEq ) ]
175+ #[ derive( Clone , Serialize , Debug , Deserialize , Builder , PartialEq , Default ) ]
171176#[ builder( name = "ExpiresAfterParamArgs" ) ]
172177#[ builder( pattern = "mutable" ) ]
173- #[ builder( setter( into, strip_option) ) ]
178+ #[ builder( setter( into, strip_option) , default ) ]
174179#[ builder( derive( Debug ) ) ]
175180#[ builder( build_fn( error = "OpenAIError" ) ) ]
176181pub struct ExpiresAfterParam {
@@ -187,7 +192,7 @@ fn default_anchor() -> String {
187192}
188193
189194/// Controls request rate limits for the session.
190- #[ derive( Clone , Serialize , Default , Debug , Deserialize , Builder , PartialEq ) ]
195+ #[ derive( Clone , Serialize , Debug , Deserialize , Builder , PartialEq , Default ) ]
191196#[ builder( name = "RateLimitsParamArgs" ) ]
192197#[ builder( pattern = "mutable" ) ]
193198#[ builder( setter( into, strip_option) , default ) ]
@@ -200,7 +205,7 @@ pub struct RateLimitsParam {
200205}
201206
202207/// Optional per-session configuration settings for ChatKit behavior.
203- #[ derive( Clone , Serialize , Default , Debug , Deserialize , Builder , PartialEq ) ]
208+ #[ derive( Clone , Serialize , Debug , Deserialize , Builder , PartialEq , Default ) ]
204209#[ builder( name = "ChatkitConfigurationParamArgs" ) ]
205210#[ builder( pattern = "mutable" ) ]
206211#[ builder( setter( into, strip_option) , default ) ]
@@ -219,7 +224,7 @@ pub struct ChatkitConfigurationParam {
219224}
220225
221226/// Controls whether ChatKit automatically generates thread titles.
222- #[ derive( Clone , Serialize , Default , Debug , Deserialize , Builder , PartialEq ) ]
227+ #[ derive( Clone , Serialize , Debug , Deserialize , Builder , PartialEq , Default ) ]
223228#[ builder( name = "AutomaticThreadTitlingParamArgs" ) ]
224229#[ builder( pattern = "mutable" ) ]
225230#[ builder( setter( into, strip_option) , default ) ]
@@ -232,7 +237,7 @@ pub struct AutomaticThreadTitlingParam {
232237}
233238
234239/// Controls whether users can upload files.
235- #[ derive( Clone , Serialize , Default , Debug , Deserialize , Builder , PartialEq ) ]
240+ #[ derive( Clone , Serialize , Debug , Deserialize , Builder , PartialEq , Default ) ]
236241#[ builder( name = "FileUploadParamArgs" ) ]
237242#[ builder( pattern = "mutable" ) ]
238243#[ builder( setter( into, strip_option) , default ) ]
@@ -251,7 +256,7 @@ pub struct FileUploadParam {
251256}
252257
253258/// Controls how much historical context is retained for the session.
254- #[ derive( Clone , Serialize , Default , Debug , Deserialize , Builder , PartialEq ) ]
259+ #[ derive( Clone , Serialize , Debug , Deserialize , Builder , PartialEq , Default ) ]
255260#[ builder( name = "HistoryParamArgs" ) ]
256261#[ builder( pattern = "mutable" ) ]
257262#[ builder( setter( into, strip_option) , default ) ]
0 commit comments