Class: OpenAI::Models::Graders::LabelModelGrader::Input

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/graders/label_model_grader.rb

Defined Under Namespace

Modules: Content, Role, Type

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

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

Methods included from Internal::Util::SorbetRuntimeSupport

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

Constructor Details

#initialize(content: , role: , type: nil) ⇒ void

Some parameter documentations has been truncated, see OpenAI::Models::Graders::LabelModelGrader::Input for more details.

A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions.

Parameters:



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/openai/models/graders/label_model_grader.rb', line 58

class Input < OpenAI::Internal::Type::BaseModel
  # @!attribute content
  #   Inputs to the model - can contain template strings.
  #
  #   @return [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Graders::LabelModelGrader::Input::Content::OutputText, OpenAI::Models::Graders::LabelModelGrader::Input::Content::InputImage, Array<Object>]
  required :content, union: -> { OpenAI::Graders::LabelModelGrader::Input::Content }

  # @!attribute role
  #   The role of the message input. One of `user`, `assistant`, `system`, or
  #   `developer`.
  #
  #   @return [Symbol, OpenAI::Models::Graders::LabelModelGrader::Input::Role]
  required :role, enum: -> { OpenAI::Graders::LabelModelGrader::Input::Role }

  # @!attribute type
  #   The type of the message input. Always `message`.
  #
  #   @return [Symbol, OpenAI::Models::Graders::LabelModelGrader::Input::Type, nil]
  optional :type, enum: -> { OpenAI::Graders::LabelModelGrader::Input::Type }

  # @!method initialize(content:, role:, type: nil)
  #   Some parameter documentations has been truncated, see
  #   {OpenAI::Models::Graders::LabelModelGrader::Input} for more details.
  #
  #   A message input to the model with a role indicating instruction following
  #   hierarchy. Instructions given with the `developer` or `system` role take
  #   precedence over instructions given with the `user` role. Messages with the
  #   `assistant` role are presumed to have been generated by the model in previous
  #   interactions.
  #
  #   @param content [String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Graders::LabelModelGrader::Input::Content::OutputText, OpenAI::Models::Graders::LabelModelGrader::Input::Content::InputImage, Array<Object>] Inputs to the model - can contain template strings.
  #
  #   @param role [Symbol, OpenAI::Models::Graders::LabelModelGrader::Input::Role] The role of the message input. One of `user`, `assistant`, `system`, or
  #
  #   @param type [Symbol, OpenAI::Models::Graders::LabelModelGrader::Input::Type] The type of the message input. Always `message`.

  # Inputs to the model - can contain template strings.
  #
  # @see OpenAI::Models::Graders::LabelModelGrader::Input#content
  module Content
    extend OpenAI::Internal::Type::Union

    # A text input to the model.
    variant String

    # A text input to the model.
    variant -> { OpenAI::Responses::ResponseInputText }

    # A text output from the model.
    variant -> { OpenAI::Graders::LabelModelGrader::Input::Content::OutputText }

    # An image input to the model.
    variant -> { OpenAI::Graders::LabelModelGrader::Input::Content::InputImage }

    # A list of inputs, each of which may be either an input text or input image object.
    variant -> { OpenAI::Models::Graders::LabelModelGrader::Input::Content::AnArrayOfInputTextAndInputImageArray }

    class OutputText < OpenAI::Internal::Type::BaseModel
      # @!attribute text
      #   The text output from the model.
      #
      #   @return [String]
      required :text, String

      # @!attribute type
      #   The type of the output text. Always `output_text`.
      #
      #   @return [Symbol, :output_text]
      required :type, const: :output_text

      # @!method initialize(text:, type: :output_text)
      #   Some parameter documentations has been truncated, see
      #   {OpenAI::Models::Graders::LabelModelGrader::Input::Content::OutputText} for more
      #   details.
      #
      #   A text output from the model.
      #
      #   @param text [String] The text output from the model.
      #
      #   @param type [Symbol, :output_text] The type of the output text. Always `output_text`.
    end

    class InputImage < OpenAI::Internal::Type::BaseModel
      # @!attribute image_url
      #   The URL of the image input.
      #
      #   @return [String]
      required :image_url, String

      # @!attribute type
      #   The type of the image input. Always `input_image`.
      #
      #   @return [Symbol, :input_image]
      required :type, const: :input_image

      # @!attribute detail
      #   The detail level of the image to be sent to the model. One of `high`, `low`, or
      #   `auto`. Defaults to `auto`.
      #
      #   @return [String, nil]
      optional :detail, String

      # @!method initialize(image_url:, detail: nil, type: :input_image)
      #   Some parameter documentations has been truncated, see
      #   {OpenAI::Models::Graders::LabelModelGrader::Input::Content::InputImage} for more
      #   details.
      #
      #   An image input to the model.
      #
      #   @param image_url [String] The URL of the image input.
      #
      #   @param detail [String] The detail level of the image to be sent to the model. One of `high`, `low`, or
      #
      #   @param type [Symbol, :input_image] The type of the image input. Always `input_image`.
    end

    # @!method self.variants
    #   @return [Array(String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Graders::LabelModelGrader::Input::Content::OutputText, OpenAI::Models::Graders::LabelModelGrader::Input::Content::InputImage, Array<Object>)]

    # @type [OpenAI::Internal::Type::Converter]
    AnArrayOfInputTextAndInputImageArray = OpenAI::Internal::Type::ArrayOf[OpenAI::Internal::Type::Unknown]
  end

  # The role of the message input. One of `user`, `assistant`, `system`, or
  # `developer`.
  #
  # @see OpenAI::Models::Graders::LabelModelGrader::Input#role
  module Role
    extend OpenAI::Internal::Type::Enum

    USER = :user
    ASSISTANT = :assistant
    SYSTEM = :system
    DEVELOPER = :developer

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

  # The type of the message input. Always `message`.
  #
  # @see OpenAI::Models::Graders::LabelModelGrader::Input#type
  module Type
    extend OpenAI::Internal::Type::Enum

    MESSAGE = :message

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

Instance Attribute Details

#contentString, ...

Inputs to the model - can contain template strings.



63
# File 'lib/openai/models/graders/label_model_grader.rb', line 63

required :content, union: -> { OpenAI::Graders::LabelModelGrader::Input::Content }

#roleSymbol, OpenAI::Models::Graders::LabelModelGrader::Input::Role

The role of the message input. One of user, assistant, system, or developer.



70
# File 'lib/openai/models/graders/label_model_grader.rb', line 70

required :role, enum: -> { OpenAI::Graders::LabelModelGrader::Input::Role }

#typeSymbol, ...

The type of the message input. Always message.



76
# File 'lib/openai/models/graders/label_model_grader.rb', line 76

optional :type, enum: -> { OpenAI::Graders::LabelModelGrader::Input::Type }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/graders/label_model_grader.rb', line 193