Created
March 3, 2023 00:20
-
-
Save jtmuller5/3a2edca004c5746249cdc02e1710a4b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:json_annotation/json_annotation.dart'; | |
part 'gpt_usage.g.dart'; | |
@JsonSerializable(explicitToJson: true) | |
class GptUsage { | |
@JsonKey(name: 'prompt_tokens') | |
int promptTokens; | |
@JsonKey(name: 'completion_tokens') | |
int completionTokens; | |
@JsonKey(name: 'total_tokens') | |
int totalTokens; | |
GptUsage({ | |
required this.promptTokens, | |
required this.completionTokens, | |
required this.totalTokens, | |
}); | |
factory GptUsage.fromJson(Map<String, dynamic> json) => _$GptUsageFromJson(json); | |
Map<String, dynamic> toJson() => _$GptUsageToJson(this); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment