Class: Deeprails::Models::DefendResponse::Event::Evaluation

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/deeprails/models/defend_response.rb

Defined Under Namespace

Modules: ImprovementToolStatus

Instance Attribute 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, meta_info, 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(analysis_of_failures: nil, attempt: nil, created_at: nil, error_message: nil, evaluation_result: nil, evaluation_status: nil, evaluation_total_cost: nil, guardrail_metrics: nil, improvement_tool_status: nil, key_improvements: nil, model_input: nil, model_output: nil, modified_at: nil, nametag: nil, progress: nil, run_mode: nil) ⇒ Object

Some parameter documentations has been truncated, see Deeprails::Models::DefendResponse::Event::Evaluation for more details.

Parameters:

  • analysis_of_failures (String) (defaults to: nil) —

    Analysis of the failures of the model_output according to the guardrail metrics

  • attempt (String) (defaults to: nil) —

    The attempt number or identifier for this evaluation.

  • created_at (Time) (defaults to: nil) —

    The time the evaluation was created in UTC.

  • error_message (String) (defaults to: nil) —

    Error message if the evaluation failed.

  • evaluation_result (Hash{Symbol=>Object}) (defaults to: nil) —

    The result of the evaluation.

  • evaluation_status (String) (defaults to: nil) —

    Status of the evaluation.

  • evaluation_total_cost (Float) (defaults to: nil) —

    Total cost of the evaluation.

  • guardrail_metrics (Array<String>) (defaults to: nil) —

    An array of guardrail metrics evaluated.

  • improvement_tool_status (Symbol, Deeprails::Models::DefendResponse::Event::Evaluation::ImprovementToolStatus) (defaults to: nil) —

    Status of the improvement tool used to improve the event. improvement_required

  • key_improvements (Array<String>) (defaults to: nil) —

    A list of key improvements made to the model_output to address the failures.

  • model_input (Hash{Symbol=>Object}) (defaults to: nil) —

    The model input used for the evaluation.

  • model_output (String) (defaults to: nil) —

    The model output that was evaluated.

  • modified_at (Time) (defaults to: nil) —

    The time the evaluation was last modified in UTC.

  • nametag (String) (defaults to: nil) —

    An optional tag for the evaluation.

  • progress (Integer) (defaults to: nil) —

    Evaluation progress (0-100).

  • run_mode (String) (defaults to: nil) —

    Run mode used for the evaluation.



210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# File 'lib/deeprails/models/defend_response.rb', line 210

class Evaluation < Deeprails::Internal::Type::BaseModel
  # @!attribute analysis_of_failures
  #   Analysis of the failures of the model_output according to the guardrail metrics
  #   evaluated.
  #
  #   @return [String, nil]
  optional :analysis_of_failures, String

  # @!attribute attempt
  #   The attempt number or identifier for this evaluation.
  #
  #   @return [String, nil]
  optional :attempt, String

  # @!attribute created_at
  #   The time the evaluation was created in UTC.
  #
  #   @return [Time, nil]
  optional :created_at, Time

  # @!attribute error_message
  #   Error message if the evaluation failed.
  #
  #   @return [String, nil]
  optional :error_message, String

  # @!attribute evaluation_result
  #   The result of the evaluation.
  #
  #   @return [Hash{Symbol=>Object}, nil]
  optional :evaluation_result, Deeprails::Internal::Type::HashOf[Deeprails::Internal::Type::Unknown]

  # @!attribute evaluation_status
  #   Status of the evaluation.
  #
  #   @return [String, nil]
  optional :evaluation_status, String

  # @!attribute evaluation_total_cost
  #   Total cost of the evaluation.
  #
  #   @return [Float, nil]
  optional :evaluation_total_cost, Float

  # @!attribute guardrail_metrics
  #   An array of guardrail metrics evaluated.
  #
  #   @return [Array<String>, nil]
  optional :guardrail_metrics, Deeprails::Internal::Type::ArrayOf[String]

  # @!attribute improvement_tool_status
  #   Status of the improvement tool used to improve the event. `improvement_required`
  #   indicates that the evaluation is complete and the improvement action is needed
  #   but is not taking place. `improved` and `improvement_failed` indicate when the
  #   improvement action concludes, successfully and unsuccessfully, respectively.
  #   `no_improvement_required` means that the first evaluation passed all its
  #   metrics!
  #
  #   @return [Symbol, Deeprails::Models::DefendResponse::Event::Evaluation::ImprovementToolStatus, nil]
  optional :improvement_tool_status,
           enum: -> { Deeprails::DefendResponse::Event::Evaluation::ImprovementToolStatus }

  # @!attribute key_improvements
  #   A list of key improvements made to the model_output to address the failures.
  #
  #   @return [Array<String>, nil]
  optional :key_improvements, Deeprails::Internal::Type::ArrayOf[String]

  # @!attribute model_input
  #   The model input used for the evaluation.
  #
  #   @return [Hash{Symbol=>Object}, nil]
  optional :model_input, Deeprails::Internal::Type::HashOf[Deeprails::Internal::Type::Unknown]

  # @!attribute model_output
  #   The model output that was evaluated.
  #
  #   @return [String, nil]
  optional :model_output, String

  # @!attribute modified_at
  #   The time the evaluation was last modified in UTC.
  #
  #   @return [Time, nil]
  optional :modified_at, Time

  # @!attribute nametag
  #   An optional tag for the evaluation.
  #
  #   @return [String, nil]
  optional :nametag, String

  # @!attribute progress
  #   Evaluation progress (0-100).
  #
  #   @return [Integer, nil]
  optional :progress, Integer

  # @!attribute run_mode
  #   Run mode used for the evaluation.
  #
  #   @return [String, nil]
  optional :run_mode, String

  # @!method initialize(analysis_of_failures: nil, attempt: nil, created_at: nil, error_message: nil, evaluation_result: nil, evaluation_status: nil, evaluation_total_cost: nil, guardrail_metrics: nil, improvement_tool_status: nil, key_improvements: nil, model_input: nil, model_output: nil, modified_at: nil, nametag: nil, progress: nil, run_mode: nil)
  #   Some parameter documentations has been truncated, see
  #   {Deeprails::Models::DefendResponse::Event::Evaluation} for more details.
  #
  #   @param analysis_of_failures [String] Analysis of the failures of the model_output according to the guardrail metrics
  #
  #   @param attempt [String] The attempt number or identifier for this evaluation.
  #
  #   @param created_at [Time] The time the evaluation was created in UTC.
  #
  #   @param error_message [String] Error message if the evaluation failed.
  #
  #   @param evaluation_result [Hash{Symbol=>Object}] The result of the evaluation.
  #
  #   @param evaluation_status [String] Status of the evaluation.
  #
  #   @param evaluation_total_cost [Float] Total cost of the evaluation.
  #
  #   @param guardrail_metrics [Array<String>] An array of guardrail metrics evaluated.
  #
  #   @param improvement_tool_status [Symbol, Deeprails::Models::DefendResponse::Event::Evaluation::ImprovementToolStatus] Status of the improvement tool used to improve the event. `improvement_required`
  #
  #   @param key_improvements [Array<String>] A list of key improvements made to the model_output to address the failures.
  #
  #   @param model_input [Hash{Symbol=>Object}] The model input used for the evaluation.
  #
  #   @param model_output [String] The model output that was evaluated.
  #
  #   @param modified_at [Time] The time the evaluation was last modified in UTC.
  #
  #   @param nametag [String] An optional tag for the evaluation.
  #
  #   @param progress [Integer] Evaluation progress (0-100).
  #
  #   @param run_mode [String] Run mode used for the evaluation.

  # Status of the improvement tool used to improve the event. `improvement_required`
  # indicates that the evaluation is complete and the improvement action is needed
  # but is not taking place. `improved` and `improvement_failed` indicate when the
  # improvement action concludes, successfully and unsuccessfully, respectively.
  # `no_improvement_required` means that the first evaluation passed all its
  # metrics!
  #
  # @see Deeprails::Models::DefendResponse::Event::Evaluation#improvement_tool_status
  module ImprovementToolStatus
    extend Deeprails::Internal::Type::Enum

    IMPROVED = :improved
    IMPROVEMENT_FAILED = :improvement_failed
    NO_IMPROVEMENT_REQUIRED = :no_improvement_required
    IMPROVEMENT_REQUIRED = :improvement_required

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

Instance Attribute Details

#analysis_of_failures ⇒ String?

Analysis of the failures of the model_output according to the guardrail metrics evaluated.

Returns:

  • (String, nil)


216
# File 'lib/deeprails/models/defend_response.rb', line 216

optional :analysis_of_failures, String

#attempt ⇒ String?

The attempt number or identifier for this evaluation.

Returns:

  • (String, nil)


222
# File 'lib/deeprails/models/defend_response.rb', line 222

optional :attempt, String

#created_at ⇒ Time?

The time the evaluation was created in UTC.

Returns:

  • (Time, nil)


228
# File 'lib/deeprails/models/defend_response.rb', line 228

optional :created_at, Time

#error_message ⇒ String?

Error message if the evaluation failed.

Returns:

  • (String, nil)


234
# File 'lib/deeprails/models/defend_response.rb', line 234

optional :error_message, String

#evaluation_result ⇒ Hash{Symbol=>Object}?

The result of the evaluation.

Returns:

  • (Hash{Symbol=>Object}, nil)


240
# File 'lib/deeprails/models/defend_response.rb', line 240

optional :evaluation_result, Deeprails::Internal::Type::HashOf[Deeprails::Internal::Type::Unknown]

#evaluation_status ⇒ String?

Status of the evaluation.

Returns:

  • (String, nil)


246
# File 'lib/deeprails/models/defend_response.rb', line 246

optional :evaluation_status, String

#evaluation_total_cost ⇒ Float?

Total cost of the evaluation.

Returns:

  • (Float, nil)


252
# File 'lib/deeprails/models/defend_response.rb', line 252

optional :evaluation_total_cost, Float

#guardrail_metrics ⇒ Array<String>?

An array of guardrail metrics evaluated.

Returns:

  • (Array<String>, nil)


258
# File 'lib/deeprails/models/defend_response.rb', line 258

optional :guardrail_metrics, Deeprails::Internal::Type::ArrayOf[String]

#improvement_tool_status ⇒ Symbol, ...

Status of the improvement tool used to improve the event. improvement_required indicates that the evaluation is complete and the improvement action is needed but is not taking place. improved and improvement_failed indicate when the improvement action concludes, successfully and unsuccessfully, respectively. no_improvement_required means that the first evaluation passed all its metrics!



269
270
# File 'lib/deeprails/models/defend_response.rb', line 269

optional :improvement_tool_status,
enum: -> { Deeprails::DefendResponse::Event::Evaluation::ImprovementToolStatus }

#key_improvements ⇒ Array<String>?

A list of key improvements made to the model_output to address the failures.

Returns:

  • (Array<String>, nil)


276
# File 'lib/deeprails/models/defend_response.rb', line 276

optional :key_improvements, Deeprails::Internal::Type::ArrayOf[String]

#model_input ⇒ Hash{Symbol=>Object}?

The model input used for the evaluation.

Returns:

  • (Hash{Symbol=>Object}, nil)


282
# File 'lib/deeprails/models/defend_response.rb', line 282

optional :model_input, Deeprails::Internal::Type::HashOf[Deeprails::Internal::Type::Unknown]

#model_output ⇒ String?

The model output that was evaluated.

Returns:

  • (String, nil)


288
# File 'lib/deeprails/models/defend_response.rb', line 288

optional :model_output, String

#modified_at ⇒ Time?

The time the evaluation was last modified in UTC.

Returns:

  • (Time, nil)


294
# File 'lib/deeprails/models/defend_response.rb', line 294

optional :modified_at, Time

#nametag ⇒ String?

An optional tag for the evaluation.

Returns:

  • (String, nil)


300
# File 'lib/deeprails/models/defend_response.rb', line 300

optional :nametag, String

#progress ⇒ Integer?

Evaluation progress (0-100).

Returns:

  • (Integer, nil)


306
# File 'lib/deeprails/models/defend_response.rb', line 306

optional :progress, Integer

#run_mode ⇒ String?

Run mode used for the evaluation.

Returns:

  • (String, nil)


312
# File 'lib/deeprails/models/defend_response.rb', line 312

optional :run_mode, String