@@ -9,9 +9,10 @@ use serde::{Deserialize, Serialize};
99use std:: collections:: HashMap ;
1010
1111/// Role of messages in the API.
12- #[ derive( Debug , Serialize , Deserialize , Clone , Copy , PartialEq ) ]
12+ #[ derive( Debug , Serialize , Deserialize , Clone , Copy , PartialEq , Default ) ]
1313#[ serde( rename_all = "lowercase" ) ]
1414pub enum Role {
15+ #[ default]
1516 User ,
1617 Assistant ,
1718 System ,
@@ -583,10 +584,10 @@ pub struct CreateResponse {
583584 /// - `web_search_call.action.sources`: Include the sources of the web search tool call.
584585 ///
585586 /// - `code_interpreter_call.outputs`: Includes the outputs of python code execution in code
586- /// interpreter tool call items.
587+ /// interpreter tool call items.
587588 ///
588589 /// - `computer_call_output.output.image_url`: Include image urls from the computer call
589- /// output.
590+ /// output.
590591 ///
591592 /// - `file_search_call.results`: Include the search results of the file search tool call.
592593 ///
@@ -595,9 +596,9 @@ pub struct CreateResponse {
595596 /// - `message.output_text.logprobs`: Include logprobs with assistant messages.
596597 ///
597598 /// - `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in
598- /// reasoning item outputs. This enables reasoning items to be used in multi-turn
599- /// conversations when using the Responses API statelessly (like when the `store` parameter is
600- /// set to `false`, or when an organization is enrolled in the zero data retention program).
599+ /// reasoning item outputs. This enables reasoning items to be used in multi-turn
600+ /// conversations when using the Responses API statelessly (like when the `store` parameter is
601+ /// set to `false`, or when an organization is enrolled in the zero data retention program).
601602 #[ serde( skip_serializing_if = "Option::is_none" ) ]
602603 pub include : Option < Vec < IncludeEnum > > ,
603604
@@ -760,10 +761,10 @@ pub struct CreateResponse {
760761
761762 ///The truncation strategy to use for the model response.
762763 /// - `auto`: If the input to this Response exceeds
763- /// the model's context window size, the model will truncate the
764- /// response to fit the context window by dropping items from the beginning of the conversation.
764+ /// the model's context window size, the model will truncate the
765+ /// response to fit the context window by dropping items from the beginning of the conversation.
765766 /// - `disabled` (default): If the input size will exceed the context window
766- /// size for a model, the request will fail with a 400 error.
767+ /// size for a model, the request will fail with a 400 error.
767768 #[ serde( skip_serializing_if = "Option::is_none" ) ]
768769 pub truncation : Option < Truncation > ,
769770}
@@ -2333,10 +2334,10 @@ pub struct Response {
23332334
23342335 ///The truncation strategy to use for the model response.
23352336 /// - `auto`: If the input to this Response exceeds
2336- /// the model's context window size, the model will truncate the
2337- /// response to fit the context window by dropping items from the beginning of the conversation.
2337+ /// the model's context window size, the model will truncate the
2338+ /// response to fit the context window by dropping items from the beginning of the conversation.
23382339 /// - `disabled` (default): If the input size will exceed the context window
2339- /// size for a model, the request will fail with a 400 error.
2340+ /// size for a model, the request will fail with a 400 error.
23402341 #[ serde( skip_serializing_if = "Option::is_none" ) ]
23412342 pub truncation : Option < Truncation > ,
23422343
@@ -2539,10 +2540,10 @@ pub struct TokenCountsBody {
25392540
25402541 ///The truncation strategy to use for the model response.
25412542 /// - `auto`: If the input to this Response exceeds
2542- /// the model's context window size, the model will truncate the
2543- /// response to fit the context window by dropping items from the beginning of the conversation.
2543+ /// the model's context window size, the model will truncate the
2544+ /// response to fit the context window by dropping items from the beginning of the conversation.
25442545 /// - `disabled` (default): If the input size will exceed the context window
2545- /// size for a model, the request will fail with a 400 error.
2546+ /// size for a model, the request will fail with a 400 error.
25462547 #[ serde( skip_serializing_if = "Option::is_none" ) ]
25472548 pub truncation : Option < Truncation > ,
25482549}
0 commit comments