Last active
March 3, 2023 10:57
-
-
Save jtmuller5/aa29f4a976ef51e65056861a91f2dd89 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 'gpt_choice.dart'; | |
import 'gpt_usage.dart'; | |
import 'package:json_annotation/json_annotation.dart'; | |
part 'gpt_message.g.dart'; | |
@JsonSerializable(explicitToJson: true) | |
class GptMessage { | |
String id; | |
String object; | |
int created; | |
String model; | |
GptUsage usage; | |
List<GptChoice> choices; | |
GptMessage({ | |
required this.id, | |
required this.object, | |
required this.created, | |
required this.model, | |
required this.usage, | |
required this.choices, | |
}); | |
factory GptMessage.fromJson(Map<String, dynamic> json) => _$GptMessageFromJson(json); | |
Map<String, dynamic> toJson() => _$GptMessageToJson(this); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment