Class: Riffer::Evals::Profile::Builder
- Inherits:
-
Object
- Object
- Riffer::Evals::Profile::Builder
- Defined in:
- lib/riffer/evals/profile.rb
Overview
DSL builder for configuring metrics within ai_evals block.
Instance Attribute Summary collapse
-
#metrics ⇒ Object
readonly
The configured metrics.
Instance Method Summary collapse
-
#initialize ⇒ Builder
constructor
: () -> void.
-
#metric(identifier, min: nil, max: nil, weight: 1.0) ⇒ Object
Defines a metric with thresholds.
Constructor Details
#initialize ⇒ Builder
: () -> void
46 47 48 |
# File 'lib/riffer/evals/profile.rb', line 46 def initialize @metrics = [] end |
Instance Attribute Details
#metrics ⇒ Object (readonly)
The configured metrics.
43 44 45 |
# File 'lib/riffer/evals/profile.rb', line 43 def metrics @metrics end |
Instance Method Details
#metric(identifier, min: nil, max: nil, weight: 1.0) ⇒ Object
Defines a metric with thresholds.
: ((Symbol | String), ?min: Float?, ?max: Float?, ?weight: Float) -> void
53 54 55 56 57 58 59 60 |
# File 'lib/riffer/evals/profile.rb', line 53 def metric(identifier, min: nil, max: nil, weight: 1.0) metrics << Riffer::Evals::Metric.new( evaluator_identifier: identifier, min: min, max: max, weight: weight ) end |