Module: OpenAI::Models::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation

Extended by:
Internal::Type::Union
Defined in:
lib/openai/models/beta/beta_response_input_item.rb

Defined Under Namespace

Classes: ContainerFileCitation, FileCitation, URLCitation

Instance Method Summary collapse

Methods included from Internal::Type::Union

==, ===, coerce, derefed_variants, dump, hash, inspect, to_sorbet_type, variants, variants

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Instance Method Details

#initialize(end_index:, start_index:, title:, url:, type: :url_citation) ⇒ Object

Parameters:

  • end_index (Integer)

    The index of the last character of the citation in the message.

  • start_index (Integer)

    The index of the first character of the citation in the message.

  • title (String)

    The title of the cited resource.

  • url (String)

    The URL of the cited resource.

  • type (Symbol, :url_citation) (defaults to: :url_citation)

    The citation type. Always url_citation.



819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
# File 'lib/openai/models/beta/beta_response_input_item.rb', line 819

module Annotation
  extend OpenAI::Internal::Type::Union

  discriminator :type

  variant :file_citation,
          -> { OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::FileCitation }

  variant :url_citation,
          -> { OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::URLCitation }

  variant :container_file_citation,
          -> { OpenAI::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::ContainerFileCitation }

  class FileCitation < OpenAI::Internal::Type::BaseModel
    # @!attribute file_id
    #   The ID of the file.
    #
    #   @return [String]
    required :file_id, String

    # @!attribute filename
    #   The filename of the file cited.
    #
    #   @return [String]
    required :filename, String

    # @!attribute index
    #   The index of the file in the list of files.
    #
    #   @return [Integer]
    required :index, Integer

    # @!attribute type
    #   The citation type. Always `file_citation`.
    #
    #   @return [Symbol, :file_citation]
    required :type, const: :file_citation

    # @!method initialize(file_id:, filename:, index:, type: :file_citation)
    #   @param file_id [String] The ID of the file.
    #
    #   @param filename [String] The filename of the file cited.
    #
    #   @param index [Integer] The index of the file in the list of files.
    #
    #   @param type [Symbol, :file_citation] The citation type. Always `file_citation`.
  end

  class URLCitation < OpenAI::Internal::Type::BaseModel
    # @!attribute end_index
    #   The index of the last character of the citation in the message.
    #
    #   @return [Integer]
    required :end_index, Integer

    # @!attribute start_index
    #   The index of the first character of the citation in the message.
    #
    #   @return [Integer]
    required :start_index, Integer

    # @!attribute title
    #   The title of the cited resource.
    #
    #   @return [String]
    required :title, String

    # @!attribute type
    #   The citation type. Always `url_citation`.
    #
    #   @return [Symbol, :url_citation]
    required :type, const: :url_citation

    # @!attribute url
    #   The URL of the cited resource.
    #
    #   @return [String]
    required :url, String

    # @!method initialize(end_index:, start_index:, title:, url:, type: :url_citation)
    #   @param end_index [Integer] The index of the last character of the citation in the message.
    #
    #   @param start_index [Integer] The index of the first character of the citation in the message.
    #
    #   @param title [String] The title of the cited resource.
    #
    #   @param url [String] The URL of the cited resource.
    #
    #   @param type [Symbol, :url_citation] The citation type. Always `url_citation`.
  end

  class ContainerFileCitation < OpenAI::Internal::Type::BaseModel
    # @!attribute container_id
    #   The ID of the container.
    #
    #   @return [String]
    required :container_id, String

    # @!attribute end_index
    #   The index of the last character of the citation in the message.
    #
    #   @return [Integer]
    required :end_index, Integer

    # @!attribute file_id
    #   The ID of the container file.
    #
    #   @return [String]
    required :file_id, String

    # @!attribute filename
    #   The filename of the container file cited.
    #
    #   @return [String]
    required :filename, String

    # @!attribute start_index
    #   The index of the first character of the citation in the message.
    #
    #   @return [Integer]
    required :start_index, Integer

    # @!attribute type
    #   The citation type. Always `container_file_citation`.
    #
    #   @return [Symbol, :container_file_citation]
    required :type, const: :container_file_citation

    # @!method initialize(container_id:, end_index:, file_id:, filename:, start_index:, type: :container_file_citation)
    #   @param container_id [String] The ID of the container.
    #
    #   @param end_index [Integer] The index of the last character of the citation in the message.
    #
    #   @param file_id [String] The ID of the container file.
    #
    #   @param filename [String] The filename of the container file cited.
    #
    #   @param start_index [Integer] The index of the first character of the citation in the message.
    #
    #   @param type [Symbol, :container_file_citation] The citation type. Always `container_file_citation`.
  end

  # @!method self.variants
  #   @return [Array(OpenAI::Models::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::FileCitation, OpenAI::Models::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::URLCitation, OpenAI::Models::Beta::BetaResponseInputItem::MultiAgentCallOutput::Output::Annotation::ContainerFileCitation)]
end