Class: OpenAI::Models::EvalCreateParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/openai/models/eval_create_params.rb,
sig/openai/models/eval_create_params.rbs

Overview

See Also:

  • OpenAI::Resources::Evals#create

Defined Under Namespace

Modules: DataSourceConfig, TestingCriterion

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Attributes inherited from Internal::Type::BaseModel

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

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(metadata: nil, type: :stored_completions) ⇒ EvalCreateParams

Returns a new instance of EvalCreateParams.

Parameters:

  • data_source_config —

    The configuration for the data source used for the evaluation runs. Dictates the schema of the data used in the evaluation.

  • testing_criteria —

    A list of graders for all eval runs in this group. Graders can reference variables in the data source using double curly braces notation, like {{item.variable_name}}. To reference the model's output, use the sample namespace (ie, {{sample.output_text}}).

  • metadata (defaults to: nil) —

    Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format.

    Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

  • name —

    The name of the evaluation.

  • data_source_config: (OpenAI::Models::EvalCreateParams::data_source_config, { item_schema: ::Hash[Symbol, top], type: :custom, ?include_sample_schema: bool }, { type: :logs, ?metadata: ::Hash[Symbol, top] }, { type: :stored_completions, ?metadata: ::Hash[Symbol, top] })
  • testing_criteria: (::Array[OpenAI::Models::EvalCreateParams::testing_criterion])
  • metadata: (OpenAI::Models::metadata, nil) (defaults to: nil)
  • name: (String)
  • request_options: (OpenAI::request_opts)


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

Instance Attribute Details

#data_source_config ⇒ OpenAI::Models::EvalCreateParams::data_source_config

The configuration for the data source used for the evaluation runs. Dictates the schema of the data used in the evaluation.

Returns:

  • (OpenAI::Models::EvalCreateParams::data_source_config)


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

required :data_source_config, union: -> { OpenAI::EvalCreateParams::DataSourceConfig }

#metadata ⇒ OpenAI::Models::metadata?

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format.

Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

Returns:

  • (OpenAI::Models::metadata, nil)


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

optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true

#name ⇒ String?

The name of the evaluation.

Returns:

  • (String, nil)


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

optional :name, String

#testing_criteria ⇒ ::Array[OpenAI::Models::EvalCreateParams::testing_criterion]

A list of graders for all eval runs in this group. Graders can reference variables in the data source using double curly braces notation, like {{item.variable_name}}. To reference the model's output, use the sample namespace (ie, {{sample.output_text}}).

Returns:

  • (::Array[OpenAI::Models::EvalCreateParams::testing_criterion])


24
25
26
27
# File 'lib/openai/models/eval_create_params.rb', line 24

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

Class Method Details

.variants ⇒ Array(OpenAI::Models::EvalCreateParams::DataSourceConfig::Custom, OpenAI::Models::EvalCreateParams::DataSourceConfig::Logs, OpenAI::Models::EvalCreateParams::DataSourceConfig::StoredCompletions)



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

Instance Method Details

#to_hash ⇒ { data_source_config: OpenAI::Models::EvalCreateParams::data_source_config, testing_criteria: ::Array[OpenAI::Models::EvalCreateParams::testing_criterion], ?metadata: OpenAI::Models::metadata?, ?name: String, ?request_options: OpenAI::RequestOptions }

Returns:

  • ({ data_source_config: OpenAI::Models::EvalCreateParams::data_source_config, testing_criteria: ::Array[OpenAI::Models::EvalCreateParams::testing_criterion], ?metadata: OpenAI::Models::metadata?, ?name: String, ?request_options: OpenAI::RequestOptions })


90
91
92
93
94
95
96
# File 'sig/openai/models/eval_create_params.rbs', line 90

def to_hash: -> {
  data_source_config: OpenAI::Models::EvalCreateParams::data_source_config,
  testing_criteria: ::Array[OpenAI::Models::EvalCreateParams::testing_criterion],
  ?metadata: OpenAI::Models::metadata?,
  ?name: String,
  ?request_options: OpenAI::RequestOptions
}