// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: invalid_annotation_target
part of open_a_i_schema;

// ==========================================
// CLASS: ChatCompletionStreamResponseChoice
// ==========================================

/// A choice the model generated for the input prompt.
@freezed
class ChatCompletionStreamResponseChoice
    with _$ChatCompletionStreamResponseChoice {
  const ChatCompletionStreamResponseChoice._();

  /// Factory constructor for ChatCompletionStreamResponseChoice
  const factory ChatCompletionStreamResponseChoice({
    /// A chat completion delta generated by streamed model responses.
    required ChatCompletionStreamResponseDelta delta,

    /// Log probability information for the choice.
    @JsonKey(includeIfNull: false)
    ChatCompletionStreamResponseChoiceLogprobs? logprobs,

    /// The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,
    /// `length` if the maximum number of tokens specified in the request was reached,
    /// `content_filter` if content was omitted due to a flag from our content filters,
    /// `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.
    @JsonKey(
      name: 'finish_reason',
      unknownEnumValue: JsonKey.nullForUndefinedEnumValue,
    )
    required ChatCompletionFinishReason? finishReason,

    /// The index of the choice in the list of choices.
    @JsonKey(includeIfNull: false) int? index,
  }) = _ChatCompletionStreamResponseChoice;

  /// Object construction from a JSON representation
  factory ChatCompletionStreamResponseChoice.fromJson(
          Map<String, dynamic> json) =>
      _$ChatCompletionStreamResponseChoiceFromJson(json);

  /// List of all property names of schema
  static const List<String> propertyNames = [
    'delta',
    'logprobs',
    'finish_reason',
    'index'
  ];

  /// Perform validations on the schema property values
  String? validateSchema() {
    return null;
  }

  /// Map representation of object (not serialized)
  Map<String, dynamic> toMap() {
    return {
      'delta': delta,
      'logprobs': logprobs,
      'finish_reason': finishReason,
      'index': index,
    };
  }
}

// ==========================================
// CLASS: ChatCompletionStreamResponseChoiceLogprobs
// ==========================================

/// Log probability information for the choice.
@freezed
class ChatCompletionStreamResponseChoiceLogprobs
    with _$ChatCompletionStreamResponseChoiceLogprobs {
  const ChatCompletionStreamResponseChoiceLogprobs._();

  /// Factory constructor for ChatCompletionStreamResponseChoiceLogprobs
  const factory ChatCompletionStreamResponseChoiceLogprobs({
    /// A list of message content tokens with log probability information.
    @JsonKey(includeIfNull: false) List<ChatCompletionTokenLogprob>? content,

    /// A list of message refusal tokens with log probability information.
    @JsonKey(includeIfNull: false) List<ChatCompletionTokenLogprob>? refusal,
  }) = _ChatCompletionStreamResponseChoiceLogprobs;

  /// Object construction from a JSON representation
  factory ChatCompletionStreamResponseChoiceLogprobs.fromJson(
          Map<String, dynamic> json) =>
      _$ChatCompletionStreamResponseChoiceLogprobsFromJson(json);

  /// List of all property names of schema
  static const List<String> propertyNames = ['content', 'refusal'];

  /// Perform validations on the schema property values
  String? validateSchema() {
    return null;
  }

  /// Map representation of object (not serialized)
  Map<String, dynamic> toMap() {
    return {
      'content': content,
      'refusal': refusal,
    };
  }
}
