Class: RSpec::LLM::Configuration
- Inherits:
-
Object
- Object
- RSpec::LLM::Configuration
- Defined in:
- lib/rspec/llm/configuration.rb
Overview
Holds gem-wide configuration: the default client used by specs, the judge model used by LLM-as-judge matchers, an embedder callable used by the similarity matcher, and tunable thresholds/prompts.
Constant Summary collapse
- DEFAULT_SIMILARITY_THRESHOLD =
0.8- DEFAULT_JUDGE_PROMPT =
<<~PROMPT You are a strict evaluator. Read the response and decide whether it satisfies the criterion. Reply with YES or NO on the first line, then a single short sentence explaining your decision. Response: %<response>s Criterion: %<criterion>s PROMPT
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#embedder ⇒ Object
Returns the value of attribute embedder.
-
#judge ⇒ Object
Returns the value of attribute judge.
-
#judge_prompt_template ⇒ Object
Returns the value of attribute judge_prompt_template.
-
#similarity_threshold ⇒ Object
Returns the value of attribute similarity_threshold.
Instance Method Summary collapse
- #client_adapter ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #judge_adapter ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
24 25 26 27 |
# File 'lib/rspec/llm/configuration.rb', line 24 def initialize @similarity_threshold = DEFAULT_SIMILARITY_THRESHOLD @judge_prompt_template = DEFAULT_JUDGE_PROMPT end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
22 23 24 |
# File 'lib/rspec/llm/configuration.rb', line 22 def client @client end |
#embedder ⇒ Object
Returns the value of attribute embedder.
22 23 24 |
# File 'lib/rspec/llm/configuration.rb', line 22 def @embedder end |
#judge ⇒ Object
Returns the value of attribute judge.
22 23 24 |
# File 'lib/rspec/llm/configuration.rb', line 22 def judge @judge end |
#judge_prompt_template ⇒ Object
Returns the value of attribute judge_prompt_template.
22 23 24 |
# File 'lib/rspec/llm/configuration.rb', line 22 def judge_prompt_template @judge_prompt_template end |
#similarity_threshold ⇒ Object
Returns the value of attribute similarity_threshold.
22 23 24 |
# File 'lib/rspec/llm/configuration.rb', line 22 def similarity_threshold @similarity_threshold end |