Class: CleoQualityReview::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/cleo_quality_review/formatter.rb

Overview

Formats quality review results using an LLM with format-specific prompts

Instance Method Summary collapse

Constructor Details

#initialize(run:, command_runner:, llm_config: LlmConfig.new, llm_client: nil) ⇒ Formatter

Returns a new instance of Formatter.

Parameters:

  • run (Run)

    the quality review run to format

  • command_runner (CommandRunner)

    for executing shell commands

  • llm_config (LlmConfig) (defaults to: LlmConfig.new)

    LLM provider configuration

  • llm_client (LlmClient, nil) (defaults to: nil)

    optional pre-configured client



18
19
20
21
22
23
# File 'lib/cleo_quality_review/formatter.rb', line 18

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

#formatString

Format the run by generating an LLM review

Returns:

  • (String)

    formatted review text



28
29
30
# File 'lib/cleo_quality_review/formatter.rb', line 28

def format
  llm_client.generate_review(prompt)
end