Class: RubyLLM::Contract::RakeTask

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/ruby_llm/contract/rake_task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = :"ruby_llm_contract:eval", &block) ⇒ RakeTask

Returns a new instance of RakeTask.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ruby_llm/contract/rake_task.rb', line 12

def initialize(name = :"ruby_llm_contract:eval", &block)
  super()
  @name = name
  @context = {}
  @fail_on_empty = true
  @minimum_score = nil # nil = require 100%; float = threshold
  @maximum_cost = nil  # nil = no cost limit; float = budget cap (suite-level)
  @eval_dirs = []      # directories to load eval files from (non-Rails)
  @save_baseline = false
  @fail_on_regression = false
  @track_history = false
  block&.call(self)
  define_task
end

Instance Attribute Details

#contextObject

Returns the value of attribute context.



9
10
11
# File 'lib/ruby_llm/contract/rake_task.rb', line 9

def context
  @context
end

#eval_dirsObject

Returns the value of attribute eval_dirs.



9
10
11
# File 'lib/ruby_llm/contract/rake_task.rb', line 9

def eval_dirs
  @eval_dirs
end

#fail_on_emptyObject

Returns the value of attribute fail_on_empty.



9
10
11
# File 'lib/ruby_llm/contract/rake_task.rb', line 9

def fail_on_empty
  @fail_on_empty
end

#fail_on_regressionObject

Returns the value of attribute fail_on_regression.



9
10
11
# File 'lib/ruby_llm/contract/rake_task.rb', line 9

def fail_on_regression
  @fail_on_regression
end

#maximum_costObject

Returns the value of attribute maximum_cost.



9
10
11
# File 'lib/ruby_llm/contract/rake_task.rb', line 9

def maximum_cost
  @maximum_cost
end

#minimum_scoreObject

Returns the value of attribute minimum_score.



9
10
11
# File 'lib/ruby_llm/contract/rake_task.rb', line 9

def minimum_score
  @minimum_score
end

#nameObject

Returns the value of attribute name.



9
10
11
# File 'lib/ruby_llm/contract/rake_task.rb', line 9

def name
  @name
end

#save_baselineObject

Returns the value of attribute save_baseline.



9
10
11
# File 'lib/ruby_llm/contract/rake_task.rb', line 9

def save_baseline
  @save_baseline
end

#track_historyObject

Returns the value of attribute track_history.



9
10
11
# File 'lib/ruby_llm/contract/rake_task.rb', line 9

def track_history
  @track_history
end