// 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: ChatCompletionStreamResponseDelta
// ==========================================

/// A chat completion delta generated by streamed model responses.
@freezed
class ChatCompletionStreamResponseDelta
    with _$ChatCompletionStreamResponseDelta {
  const ChatCompletionStreamResponseDelta._();

  /// Factory constructor for ChatCompletionStreamResponseDelta
  const factory ChatCompletionStreamResponseDelta({
    /// The contents of the chunk message.
    @JsonKey(includeIfNull: false) String? content,

    /// The refusal message generated by the model.
    @JsonKey(includeIfNull: false) String? refusal,

    /// The name and arguments of a function that should be called, as generated by the model.
    @JsonKey(name: 'function_call', includeIfNull: false)
    ChatCompletionStreamMessageFunctionCall? functionCall,

    /// No Description
    @JsonKey(name: 'tool_calls', includeIfNull: false)
    List<ChatCompletionStreamMessageToolCallChunk>? toolCalls,

    /// The role of the messages author. One of `system`, `user`, `assistant`, or `tool` (`function` is deprecated).
    @JsonKey(
      includeIfNull: false,
      unknownEnumValue: JsonKey.nullForUndefinedEnumValue,
    )
    ChatCompletionMessageRole? role,
  }) = _ChatCompletionStreamResponseDelta;

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

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

  /// 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,
      'function_call': functionCall,
      'tool_calls': toolCalls,
      'role': role,
    };
  }
}
