Last active
March 3, 2023 10:57
-
-
Save jtmuller5/3a38aee3216b6a71ac31970ec132ef6a 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_message.dart'; | |
import 'package:json_annotation/json_annotation.dart'; | |
part 'gpt_choice.g.dart'; | |
@JsonSerializable(explicitToJson: true) | |
class GptChoice { | |
GptChoiceMessage message; | |
@JsonKey(name: 'finish_reason') | |
String? finishReason; | |
int index; | |
// Constructor | |
GptChoice({required this.message, required this.finishReason, required this.index}); | |
// Factory | |
factory GptChoice.fromJson(Map<String, dynamic> json) => _$GptChoiceFromJson(json); | |
// To Json | |
Map<String, dynamic> toJson() => _$GptChoiceToJson(this); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment