# frozen_string_literal: true

module OpenAI
  module Models
    module Chat
      class ChatCompletionMessageCustomToolCall < OpenAI::Internal::Type::BaseModel
        # @!attribute id
        #   The ID of the tool call.
        #
        #   @return [String]
        required :id, String

        # @!attribute custom
        #   The custom tool that the model called.
        #
        #   @return [OpenAI::Models::Chat::ChatCompletionMessageCustomToolCall::Custom]
        required :custom, -> { OpenAI::Chat::ChatCompletionMessageCustomToolCall::Custom }

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

        # @!method initialize(id:, custom:, type: :custom)
        #   A call to a custom tool created by the model.
        #
        #   @param id [String] The ID of the tool call.
        #
        #   @param custom [OpenAI::Models::Chat::ChatCompletionMessageCustomToolCall::Custom] The custom tool that the model called.
        #
        #   @param type [Symbol, :custom] The type of the tool. Always `custom`.

        # @see OpenAI::Models::Chat::ChatCompletionMessageCustomToolCall#custom
        class Custom < OpenAI::Internal::Type::BaseModel
          # @!attribute input
          #   The input for the custom tool call generated by the model.
          #
          #   @return [String]
          required :input, String

          # @!attribute name
          #   The name of the custom tool to call.
          #
          #   @return [String]
          required :name, String

          # @!method initialize(input:, name:)
          #   The custom tool that the model called.
          #
          #   @param input [String] The input for the custom tool call generated by the model.
          #
          #   @param name [String] The name of the custom tool to call.
        end
      end
    end

    ChatCompletionMessageCustomToolCall = Chat::ChatCompletionMessageCustomToolCall
  end
end
