Skip to content

Instantly share code, notes, and snippets.

@jtmuller5
Last active March 3, 2023 10:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtmuller5/aa29f4a976ef51e65056861a91f2dd89 to your computer and use it in GitHub Desktop.
Save jtmuller5/aa29f4a976ef51e65056861a91f2dd89 to your computer and use it in GitHub Desktop.
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