import 'package:json_annotation/json_annotation.dart';

part 'stream_deepseek_data.g.dart';

@JsonSerializable()
class StreamDeepseekData {
  @JsonKey(name: "id")
  final String id;
  @JsonKey(name: "object")
  final String object;
  @JsonKey(name: "created")
  final int created;
  @JsonKey(name: "model")
  final String model;
  @JsonKey(name: "choices")
  final List<Choices>? choices;

  StreamDeepseekData({
    required this.id,
    required this.object,
    required this.created,
    required this.model,

    required this.choices,
  });

  factory StreamDeepseekData.fromJson(Map<String, dynamic> json) => _$StreamDeepseekDataFromJson(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;
  @JsonKey(name: "reasoning_content")
  final String? reasoningContent;
  Delta({
    required this.role,
    required this.content,
    required this.reasoningContent,
  });

  factory Delta.fromJson(Map<String, dynamic> json) => _$DeltaFromJson(json);
}
