Class: RubyLLM::Contract::RakeTask

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

Defined Under Namespace

Classes: SuiteGate

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of RakeTask.



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

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.



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

def context
  @context
end

#eval_dirsObject

Returns the value of attribute eval_dirs.



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

def eval_dirs
  @eval_dirs
end

#fail_on_emptyObject

Returns the value of attribute fail_on_empty.



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

def fail_on_empty
  @fail_on_empty
end

#fail_on_regressionObject

Returns the value of attribute fail_on_regression.



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

def fail_on_regression
  @fail_on_regression
end

#maximum_costObject

Returns the value of attribute maximum_cost.



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

def maximum_cost
  @maximum_cost
end

#minimum_scoreObject

Returns the value of attribute minimum_score.



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

def minimum_score
  @minimum_score
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#save_baselineObject

Returns the value of attribute save_baseline.



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

def save_baseline
  @save_baseline
end

#track_historyObject

Returns the value of attribute track_history.



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

def track_history
  @track_history
end