@@ -1316,3 +1316,78 @@ pub struct CreateChatCompletionStreamResponse {
13161316 /// When present, it contains a null value except for the last chunk which contains the token usage statistics for the entire request.
13171317 pub usage : Option < CompletionUsage > ,
13181318}
1319+
1320+ /// An object representing a list of Chat Completions.
1321+ #[ derive( Debug , Deserialize , Serialize , Clone , PartialEq ) ]
1322+ pub struct ChatCompletionList {
1323+ /// The type of this object. It is always set to "list".
1324+ pub object : String ,
1325+ /// An array of chat completion objects.
1326+ pub data : Vec < CreateChatCompletionResponse > ,
1327+ /// The identifier of the first chat completion in the data array.
1328+ pub first_id : String ,
1329+ /// The identifier of the last chat completion in the data array.
1330+ pub last_id : String ,
1331+ /// Indicates whether there are more Chat Completions available.
1332+ pub has_more : bool ,
1333+ }
1334+
1335+ /// Response when deleting a chat completion.
1336+ #[ derive( Debug , Deserialize , Serialize , Clone , PartialEq ) ]
1337+ pub struct ChatCompletionDeleted {
1338+ /// The type of object being deleted.
1339+ pub object : String ,
1340+ /// The ID of the chat completion that was deleted.
1341+ pub id : String ,
1342+ /// Whether the chat completion was deleted.
1343+ pub deleted : bool ,
1344+ }
1345+
1346+ #[ derive( Debug , Serialize , Deserialize , Clone , PartialEq ) ]
1347+ #[ serde( tag = "type" ) ]
1348+ #[ serde( rename_all = "snake_case" ) ]
1349+
1350+ pub enum ContentPart {
1351+ Text ( ChatCompletionRequestMessageContentPartText ) ,
1352+ ImageUrl ( ChatCompletionRequestMessageContentPartImage ) ,
1353+ }
1354+
1355+ /// A chat completion message with additional fields for listing.
1356+ #[ derive( Debug , Deserialize , Serialize , Clone , PartialEq ) ]
1357+ pub struct ChatCompletionMessageListItem {
1358+ /// The identifier of the chat message.
1359+ pub id : String ,
1360+ /// If a content parts array was provided, this is an array of `text` and `image_url` parts. Otherwise, null.
1361+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
1362+ pub content_parts : Option < Vec < ContentPart > > ,
1363+
1364+ #[ serde( flatten) ]
1365+ pub message : ChatCompletionResponseMessage ,
1366+ }
1367+
1368+ /// An object representing a list of chat completion messages.
1369+ #[ derive( Debug , Deserialize , Serialize , Clone , PartialEq ) ]
1370+ pub struct ChatCompletionMessageList {
1371+ /// The type of this object. It is always set to "list".
1372+ pub object : String ,
1373+ /// An array of chat completion message objects.
1374+ pub data : Vec < ChatCompletionMessageListItem > ,
1375+ /// The identifier of the first chat message in the data array.
1376+ pub first_id : String ,
1377+ /// The identifier of the last chat message in the data array.
1378+ pub last_id : String ,
1379+ /// Indicates whether there are more chat messages available.
1380+ pub has_more : bool ,
1381+ }
1382+
1383+ /// Request to update a chat completion.
1384+ #[ derive( Debug , Serialize , Deserialize , Clone , PartialEq , Default , Builder ) ]
1385+ #[ builder( name = "UpdateChatCompletionRequestArgs" ) ]
1386+ #[ builder( pattern = "mutable" ) ]
1387+ #[ builder( setter( into, strip_option) , default ) ]
1388+ #[ builder( derive( Debug ) ) ]
1389+ #[ builder( build_fn( error = "OpenAIError" ) ) ]
1390+ pub struct UpdateChatCompletionRequest {
1391+ /// Set of 16 key-value pairs that can be attached to an object.
1392+ pub metadata : Metadata ,
1393+ }
0 commit comments