| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- /*
- * {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-4o-mini", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"role":"assistant","content":""},"logprobs":null,"finish_reason":null}]}
- */
- import 'package:json_annotation/json_annotation.dart';
- part 'stream_chat_origin_data.g.dart';
- @JsonSerializable()
- class StreamChatOriginData {
- @JsonKey(name: "choices")
- final List<Choices>? choices;
- StreamChatOriginData({
- required this.choices,
- });
- factory StreamChatOriginData.fromJson(Map<String, dynamic> json) =>
- _$StreamChatOriginDataFromJson(json);
- }
- @JsonSerializable()
- class Choices {
- @JsonKey(name: "index")
- final int? index;
- @JsonKey(name: "delta")
- final Delta? delta;
- @JsonKey(name: "finishReason")
- final String? finishReason;
- Choices({
- required this.index,
- required this.delta,
- required this.finishReason,
- });
- factory Choices.fromJson(Map<String, dynamic> json) =>
- _$ChoicesFromJson(json);
- }
- @JsonSerializable()
- class Delta {
- @JsonKey(name: "role")
- final String? role;
- @JsonKey(name: "content")
- final String? content;
- Delta({
- required this.role,
- required this.content,
- });
- factory Delta.fromJson(Map<String, dynamic> json) => _$DeltaFromJson(json);
- }
|