# frozen_string_literal: true

module OpenAI
  module Models
    module Realtime
      class RealtimeConversationItemAssistantMessage < OpenAI::Internal::Type::BaseModel
        # @!attribute content
        #   The content of the message.
        #
        #   @return [Array<OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Content>]
        required :content,
                 -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Realtime::RealtimeConversationItemAssistantMessage::Content] }

        # @!attribute role
        #   The role of the message sender. Always `assistant`.
        #
        #   @return [Symbol, :assistant]
        required :role, const: :assistant

        # @!attribute type
        #   The type of the item. Always `message`.
        #
        #   @return [Symbol, :message]
        required :type, const: :message

        # @!attribute id
        #   The unique ID of the item. This may be provided by the client or generated by
        #   the server.
        #
        #   @return [String, nil]
        optional :id, String

        # @!attribute object
        #   Identifier for the API object being returned - always `realtime.item`. Optional
        #   when creating a new item.
        #
        #   @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Object, nil]
        optional :object, enum: -> { OpenAI::Realtime::RealtimeConversationItemAssistantMessage::Object }

        # @!attribute status
        #   The status of the item. Has no effect on the conversation.
        #
        #   @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Status, nil]
        optional :status, enum: -> { OpenAI::Realtime::RealtimeConversationItemAssistantMessage::Status }

        # @!method initialize(content:, id: nil, object: nil, status: nil, role: :assistant, type: :message)
        #   Some parameter documentations has been truncated, see
        #   {OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage} for more
        #   details.
        #
        #   An assistant message item in a Realtime conversation.
        #
        #   @param content [Array<OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Content>] The content of the message.
        #
        #   @param id [String] The unique ID of the item. This may be provided by the client or generated by th
        #
        #   @param object [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Object] Identifier for the API object being returned - always `realtime.item`. Optional
        #
        #   @param status [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Status] The status of the item. Has no effect on the conversation.
        #
        #   @param role [Symbol, :assistant] The role of the message sender. Always `assistant`.
        #
        #   @param type [Symbol, :message] The type of the item. Always `message`.

        class Content < OpenAI::Internal::Type::BaseModel
          # @!attribute audio
          #   Base64-encoded audio bytes, these will be parsed as the format specified in the
          #   session output audio type configuration. This defaults to PCM 16-bit 24kHz mono
          #   if not specified.
          #
          #   @return [String, nil]
          optional :audio, String

          # @!attribute text
          #   The text content.
          #
          #   @return [String, nil]
          optional :text, String

          # @!attribute transcript
          #   The transcript of the audio content, this will always be present if the output
          #   type is `audio`.
          #
          #   @return [String, nil]
          optional :transcript, String

          # @!attribute type
          #   The content type, `output_text` or `output_audio` depending on the session
          #   `output_modalities` configuration.
          #
          #   @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Content::Type, nil]
          optional :type, enum: -> { OpenAI::Realtime::RealtimeConversationItemAssistantMessage::Content::Type }

          # @!method initialize(audio: nil, text: nil, transcript: nil, type: nil)
          #   Some parameter documentations has been truncated, see
          #   {OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Content}
          #   for more details.
          #
          #   @param audio [String] Base64-encoded audio bytes, these will be parsed as the format specified in the
          #
          #   @param text [String] The text content.
          #
          #   @param transcript [String] The transcript of the audio content, this will always be present if the output t
          #
          #   @param type [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Content::Type] The content type, `output_text` or `output_audio` depending on the session `outp

          # The content type, `output_text` or `output_audio` depending on the session
          # `output_modalities` configuration.
          #
          # @see OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage::Content#type
          module Type
            extend OpenAI::Internal::Type::Enum

            OUTPUT_TEXT = :output_text
            OUTPUT_AUDIO = :output_audio

            # @!method self.values
            #   @return [Array<Symbol>]
          end
        end

        # Identifier for the API object being returned - always `realtime.item`. Optional
        # when creating a new item.
        #
        # @see OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage#object
        module Object
          extend OpenAI::Internal::Type::Enum

          REALTIME_ITEM = :"realtime.item"

          # @!method self.values
          #   @return [Array<Symbol>]
        end

        # The status of the item. Has no effect on the conversation.
        #
        # @see OpenAI::Models::Realtime::RealtimeConversationItemAssistantMessage#status
        module Status
          extend OpenAI::Internal::Type::Enum

          COMPLETED = :completed
          INCOMPLETE = :incomplete
          IN_PROGRESS = :in_progress

          # @!method self.values
          #   @return [Array<Symbol>]
        end
      end
    end
  end
end
