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, coerce_with_error, 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.



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
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
# File 'lib/openai/models/beta/beta_response_input_item.rb', line 910

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