Class: RubyLLM::Contract::Step::RunnerConfig

Inherits:
Data
  • Object
show all
Defined in:
lib/ruby_llm/contract/step/runner_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#adapterObject (readonly)

Returns the value of attribute adapter

Returns:

  • (Object)

    the current value of adapter



6
7
8
# File 'lib/ruby_llm/contract/step/runner_config.rb', line 6

def adapter
  @adapter
end

#contract_definitionObject (readonly)

Returns the value of attribute contract_definition

Returns:

  • (Object)

    the current value of contract_definition



6
7
8
# File 'lib/ruby_llm/contract/step/runner_config.rb', line 6

def contract_definition
  @contract_definition
end

#extra_optionsObject (readonly)

Returns the value of attribute extra_options

Returns:

  • (Object)

    the current value of extra_options



6
7
8
# File 'lib/ruby_llm/contract/step/runner_config.rb', line 6

def extra_options
  @extra_options
end

#input_typeObject (readonly)

Returns the value of attribute input_type

Returns:

  • (Object)

    the current value of input_type



6
7
8
# File 'lib/ruby_llm/contract/step/runner_config.rb', line 6

def input_type
  @input_type
end

#max_costObject (readonly)

Returns the value of attribute max_cost

Returns:

  • (Object)

    the current value of max_cost



6
7
8
# File 'lib/ruby_llm/contract/step/runner_config.rb', line 6

def max_cost
  @max_cost
end

#max_inputObject (readonly)

Returns the value of attribute max_input

Returns:

  • (Object)

    the current value of max_input



6
7
8
# File 'lib/ruby_llm/contract/step/runner_config.rb', line 6

def max_input
  @max_input
end

#max_outputObject (readonly)

Returns the value of attribute max_output

Returns:

  • (Object)

    the current value of max_output



6
7
8
# File 'lib/ruby_llm/contract/step/runner_config.rb', line 6

def max_output
  @max_output
end

#modelObject (readonly)

Returns the value of attribute model

Returns:

  • (Object)

    the current value of model



6
7
8
# File 'lib/ruby_llm/contract/step/runner_config.rb', line 6

def model
  @model
end

#observersObject (readonly)

Returns the value of attribute observers

Returns:

  • (Object)

    the current value of observers



6
7
8
# File 'lib/ruby_llm/contract/step/runner_config.rb', line 6

def observers
  @observers
end

#on_unknown_pricingObject (readonly)

Returns the value of attribute on_unknown_pricing

Returns:

  • (Object)

    the current value of on_unknown_pricing



6
7
8
# File 'lib/ruby_llm/contract/step/runner_config.rb', line 6

def on_unknown_pricing
  @on_unknown_pricing
end

#output_schemaObject (readonly)

Returns the value of attribute output_schema

Returns:

  • (Object)

    the current value of output_schema



6
7
8
# File 'lib/ruby_llm/contract/step/runner_config.rb', line 6

def output_schema
  @output_schema
end

#output_typeObject (readonly)

Returns the value of attribute output_type

Returns:

  • (Object)

    the current value of output_type



6
7
8
# File 'lib/ruby_llm/contract/step/runner_config.rb', line 6

def output_type
  @output_type
end

#prompt_blockObject (readonly)

Returns the value of attribute prompt_block

Returns:

  • (Object)

    the current value of prompt_block



6
7
8
# File 'lib/ruby_llm/contract/step/runner_config.rb', line 6

def prompt_block
  @prompt_block
end

#temperatureObject (readonly)

Returns the value of attribute temperature

Returns:

  • (Object)

    the current value of temperature



6
7
8
# File 'lib/ruby_llm/contract/step/runner_config.rb', line 6

def temperature
  @temperature
end

Instance Method Details

#adapter_optionsObject



26
27
28
29
30
31
32
33
# File 'lib/ruby_llm/contract/step/runner_config.rb', line 26

def adapter_options
  { model: model }.tap do |options|
    options[:schema] = output_schema if output_schema
    options[:max_tokens] = effective_max_output if effective_max_output
    options[:temperature] = temperature if temperature
    extra_options.each { |key, value| options[key] = value unless options.key?(key) }
  end
end

#effective_max_outputObject



22
23
24
# File 'lib/ruby_llm/contract/step/runner_config.rb', line 22

def effective_max_output
  extra_options[:max_tokens] || max_output
end