Class: OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/eval_create_params.rb,
sig/openai/models/eval_create_params.rbs

Defined Under Namespace

Modules: Input

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, 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, coerce_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, 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(input:, labels:, model:, name:, passing_labels:, type: :label_model) ⇒ LabelModel

Returns a new instance of LabelModel.

Parameters:

  • input —

    A list of chat messages forming the prompt or context. May include variable references to the item namespace, ie OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel.{item{item.name}.

  • labels —

    The labels to classify to each item in the evaluation.

  • model —

    The model to use for the evaluation. Must support structured outputs.

  • name —

    The name of the grader.

  • passing_labels —

    The labels that indicate a passing result. Must be a subset of labels.

  • type (defaults to: :label_model) —

    The object type, which is always label_model.

  • input: (::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::input | { content: String, role: String }])
  • labels: (::Array[String])
  • model: (String)
  • name: (String)
  • passing_labels: (::Array[String])
  • type: (:label_model) (defaults to: :label_model)


# File 'lib/openai/models/eval_create_params.rb', line 245

Instance Attribute Details

#input ⇒ ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::input]

A list of chat messages forming the prompt or context. May include variable references to the item namespace, ie OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel.{item{item.name}.

Returns:

  • (::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::input])


208
209
210
211
212
213
# File 'lib/openai/models/eval_create_params.rb', line 208

required(
  :input,
  -> {
    OpenAI::Internal::Type::ArrayOf[union: OpenAI::EvalCreateParams::TestingCriterion::LabelModel::Input]
  }
)

#labels ⇒ ::Array[String]

The labels to classify to each item in the evaluation.

Returns:

  • (::Array[String])


219
# File 'lib/openai/models/eval_create_params.rb', line 219

required :labels, OpenAI::Internal::Type::ArrayOf[String]

#model ⇒ String

The model to use for the evaluation. Must support structured outputs.

Returns:

  • (String)


225
# File 'lib/openai/models/eval_create_params.rb', line 225

required :model, String

#name ⇒ String

The name of the grader.

Returns:

  • (String)


231
# File 'lib/openai/models/eval_create_params.rb', line 231

required :name, String

#passing_labels ⇒ ::Array[String]

The labels that indicate a passing result. Must be a subset of labels.

Returns:

  • (::Array[String])


237
# File 'lib/openai/models/eval_create_params.rb', line 237

required :passing_labels, OpenAI::Internal::Type::ArrayOf[String]

#type ⇒ :label_model

The object type, which is always label_model.

Returns:

  • (:label_model)


243
# File 'lib/openai/models/eval_create_params.rb', line 243

required :type, const: :label_model

Instance Method Details

#to_hash ⇒ { input: ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::input], labels: ::Array[String], model: String, name: String, passing_labels: ::Array[String], ?type: :label_model }

Returns:

  • ({ input: ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::input], labels: ::Array[String], model: String, name: String, passing_labels: ::Array[String], ?type: :label_model })


271
272
273
274
275
276
277
278
# File 'sig/openai/models/eval_create_params.rbs', line 271

def to_hash: -> {
  input: ::Array[OpenAI::Models::EvalCreateParams::TestingCriterion::LabelModel::input],
  labels: ::Array[String],
  model: String,
  name: String,
  passing_labels: ::Array[String],
  ?type: :label_model
}