@@ -172,25 +172,6 @@ final class UsageMetadata {
172
172
final List <ModalityTokenCount >? candidatesTokensDetails;
173
173
}
174
174
175
- /// Constructe a UsageMetadata with all it's fields.
176
- ///
177
- /// Expose access to the private constructor for use within the package..
178
- UsageMetadata createUsageMetadata ({
179
- required int ? promptTokenCount,
180
- required int ? candidatesTokenCount,
181
- required int ? totalTokenCount,
182
- required int ? thoughtsTokenCount,
183
- required List <ModalityTokenCount >? promptTokensDetails,
184
- required List <ModalityTokenCount >? candidatesTokensDetails,
185
- }) =>
186
- UsageMetadata ._(
187
- promptTokenCount: promptTokenCount,
188
- candidatesTokenCount: candidatesTokenCount,
189
- totalTokenCount: totalTokenCount,
190
- thoughtsTokenCount: thoughtsTokenCount,
191
- promptTokensDetails: promptTokensDetails,
192
- candidatesTokensDetails: candidatesTokensDetails);
193
-
194
175
/// Response candidate generated from a [GenerativeModel] .
195
176
final class Candidate {
196
177
// TODO: token count?
@@ -1292,7 +1273,7 @@ UsageMetadata parseUsageMetadata(Object jsonObject) {
1292
1273
candidatesTokensDetails.map (_parseModalityTokenCount).toList (),
1293
1274
_ => null ,
1294
1275
};
1295
- return createUsageMetadata (
1276
+ return UsageMetadata ._ (
1296
1277
promptTokenCount: promptTokenCount,
1297
1278
candidatesTokenCount: candidatesTokenCount,
1298
1279
totalTokenCount: totalTokenCount,
0 commit comments