Module: RubyLLM::RedCandle::Configuration
- Defined in:
- lib/ruby_llm/red_candle/configuration.rb
Overview
Configuration options for Red Candle provider
Constant Summary collapse
- DEFAULT_JSON_INSTRUCTION =
Default JSON instruction template for structured generation Use schema_description as a placeholder for the schema description
"\n\nRespond with ONLY a valid JSON object containing: {schema_description}"
Class Method Summary collapse
-
.build_json_instruction(schema_description) ⇒ String
Build the JSON instruction by substituting the schema description.
-
.json_instruction_template ⇒ String
Get the JSON instruction template.
-
.json_instruction_template=(template) ⇒ Object
Set a custom JSON instruction template.
-
.reset! ⇒ Object
Reset configuration to defaults.
Class Method Details
.build_json_instruction(schema_description) ⇒ String
Build the JSON instruction by substituting the schema description
32 33 34 |
# File 'lib/ruby_llm/red_candle/configuration.rb', line 32 def build_json_instruction(schema_description) json_instruction_template.gsub("{schema_description}", schema_description) end |
.json_instruction_template ⇒ String
Get the JSON instruction template
14 15 16 |
# File 'lib/ruby_llm/red_candle/configuration.rb', line 14 def json_instruction_template @json_instruction_template || DEFAULT_JSON_INSTRUCTION end |
.json_instruction_template=(template) ⇒ Object
Set a custom JSON instruction template
20 21 22 |
# File 'lib/ruby_llm/red_candle/configuration.rb', line 20 def json_instruction_template=(template) @json_instruction_template = template end |
.reset! ⇒ Object
Reset configuration to defaults
25 26 27 |
# File 'lib/ruby_llm/red_candle/configuration.rb', line 25 def reset! @json_instruction_template = nil end |