Skip to content

Commit 7bb433a

Browse files
feat: adds Default to CompletionUsage (#387)
1 parent 19c9ba0 commit 7bb433a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

async-openai/src/types/chat.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub struct FunctionCall {
8585
}
8686

8787
/// Usage statistics for the completion request.
88-
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq)]
88+
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Default)]
8989
pub struct CompletionUsage {
9090
/// Number of tokens in the prompt.
9191
pub prompt_tokens: u32,
@@ -100,7 +100,7 @@ pub struct CompletionUsage {
100100
}
101101

102102
/// Breakdown of tokens used in a completion.
103-
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq)]
103+
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Default)]
104104
pub struct PromptTokensDetails {
105105
/// Audio input tokens present in the prompt.
106106
pub audio_tokens: Option<u32>,
@@ -109,7 +109,7 @@ pub struct PromptTokensDetails {
109109
}
110110

111111
/// Breakdown of tokens used in a completion.
112-
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq)]
112+
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Default)]
113113
pub struct CompletionTokensDetails {
114114
pub accepted_prediction_tokens: Option<u32>,
115115
/// Audio input tokens generated by the model.

0 commit comments

Comments
 (0)