Class: OpenAI::Models::Graders::ScoreModelGrader::Input

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/graders/score_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, 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(text: , type: :output_text) ⇒ Object

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

A text output from the model.

Parameters:

  • text (String) (defaults to: )

    The text output from the model.

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

    The type of the output text. Always ‘output_text`.



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
# File 'lib/openai/models/graders/score_model_grader.rb', line 58

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

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

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

  # @!method initialize(content:, role:, type: nil)
  #   Some parameter documentations has been truncated, see
  #   {OpenAI::Models::Graders::ScoreModelGrader::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::ScoreModelGrader::Input::Content::OutputText] Text inputs to the model - can contain template strings.
  #
  #   @param role [Symbol, OpenAI::Models::Graders::ScoreModelGrader::Input::Role] The role of the message input. One of `user`, `assistant`, `system`, or
  #
  #   @param type [Symbol, OpenAI::Models::Graders::ScoreModelGrader::Input::Type] The type of the message input. Always `message`.

  # Text inputs to the model - can contain template strings.
  #
  # @see OpenAI::Models::Graders::ScoreModelGrader::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::ScoreModelGrader::Input::Content::OutputText }

    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::ScoreModelGrader::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

    # @!method self.variants
    #   @return [Array(String, OpenAI::Models::Responses::ResponseInputText, OpenAI::Models::Graders::ScoreModelGrader::Input::Content::OutputText)]
  end

  # The role of the message input. One of `user`, `assistant`, `system`, or
  # `developer`.
  #
  # @see OpenAI::Models::Graders::ScoreModelGrader::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::ScoreModelGrader::Input#type
  module Type
    extend OpenAI::Internal::Type::Enum

    MESSAGE = :message

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

Instance Attribute Details

#contentString, ...

Text inputs to the model - can contain template strings.



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

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

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

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



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

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

#typeSymbol, ...

The type of the message input. Always ‘message`.



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

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

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/graders/score_model_grader.rb', line 150