Class: EvalRuby::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/eval_ruby/configuration.rb

Overview

Global configuration for EvalRuby.

Examples:

EvalRuby.configure do |config|
  config.judge_llm = :openai
  config.api_key = ENV["OPENAI_API_KEY"]
  config.judge_model = "gpt-4o"
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



31
32
33
34
35
36
37
38
# File 'lib/eval_ruby/configuration.rb', line 31

def initialize
  @judge_llm = :openai
  @judge_model = "gpt-4o"
  @api_key = nil
  @default_threshold = 0.7
  @timeout = 30
  @max_retries = 3
end

Instance Attribute Details

#api_keyString?

Returns API key for the judge LLM provider.

Returns:

  • (String, nil)

    API key for the judge LLM provider



20
21
22
# File 'lib/eval_ruby/configuration.rb', line 20

def api_key
  @api_key
end

#default_thresholdFloat

Returns default threshold for pass/fail decisions.

Returns:

  • (Float)

    default threshold for pass/fail decisions



23
24
25
# File 'lib/eval_ruby/configuration.rb', line 23

def default_threshold
  @default_threshold
end

#judge_llmSymbol

Returns LLM provider for judge (:openai or :anthropic).

Returns:

  • (Symbol)

    LLM provider for judge (:openai or :anthropic)



14
15
16
# File 'lib/eval_ruby/configuration.rb', line 14

def judge_llm
  @judge_llm
end

#judge_modelString

Returns model name for the judge LLM.

Returns:

  • (String)

    model name for the judge LLM



17
18
19
# File 'lib/eval_ruby/configuration.rb', line 17

def judge_model
  @judge_model
end

#max_retriesInteger

Returns maximum number of retries on transient failures.

Returns:

  • (Integer)

    maximum number of retries on transient failures



29
30
31
# File 'lib/eval_ruby/configuration.rb', line 29

def max_retries
  @max_retries
end

#timeoutInteger

Returns HTTP request timeout in seconds.

Returns:

  • (Integer)

    HTTP request timeout in seconds



26
27
28
# File 'lib/eval_ruby/configuration.rb', line 26

def timeout
  @timeout
end