Class: CleoQualityReview::Formatter
- Inherits:
-
Object
- Object
- CleoQualityReview::Formatter
- Defined in:
- lib/cleo_quality_review/formatter.rb
Overview
Formats quality review results using an LLM with format-specific prompts
Constant Summary collapse
- CONFIGURATION_FORMAT =
Format name of the shared configuration prompt applied to every run
"configuration"
Instance Method Summary collapse
-
#format ⇒ String
Format the run by generating an LLM review.
-
#initialize(run:, command_runner:, llm_config: LlmConfig.new, llm_client: nil) ⇒ Formatter
constructor
A new instance of Formatter.
Constructor Details
#initialize(run:, command_runner:, llm_config: LlmConfig.new, llm_client: nil) ⇒ Formatter
Returns a new instance of Formatter.
22 23 24 25 26 27 |
# File 'lib/cleo_quality_review/formatter.rb', line 22 def initialize(run:, command_runner:, llm_config: LlmConfig.new, llm_client: nil) @run = run @command_runner = command_runner @llm_config = llm_config @llm_client = llm_client end |
Instance Method Details
#format ⇒ String
Format the run by generating an LLM review. Returns an empty string without contacting the LLM when there are no files to review.
34 35 36 37 38 |
# File 'lib/cleo_quality_review/formatter.rb', line 34 def format return "" unless run.reviewable? llm_client.generate_review(prompt, instructions: configuration_prompt) end |