Class: SkillBench::Services::JudgeScoreParserService Deprecated
- Inherits:
-
Object
- Object
- SkillBench::Services::JudgeScoreParserService
- Defined in:
- lib/skill_bench/services/judge_score_parser_service.rb
Overview
Deprecated.
Scoring is now handled internally by Judge and DeltaReport.
Service object for parsing judge score responses from evaluation results. Handles JSON strings with optional code blocks, Hash inputs, and provides standardized error handling for malformed data.
Constant Summary collapse
- PARSE_ERROR =
'Failed to parse judge score'
Class Method Summary collapse
-
.call(judge_score) ⇒ Hash
Parses a judge score response into a standardized format.
Instance Method Summary collapse
-
#call ⇒ Hash
{ success: Boolean, response: Hash }.
-
#initialize(judge_score) ⇒ JudgeScoreParserService
constructor
A new instance of JudgeScoreParserService.
Constructor Details
#initialize(judge_score) ⇒ JudgeScoreParserService
Returns a new instance of JudgeScoreParserService.
29 30 31 |
# File 'lib/skill_bench/services/judge_score_parser_service.rb', line 29 def initialize(judge_score) @judge_score = judge_score end |
Class Method Details
.call(judge_score) ⇒ Hash
Parses a judge score response into a standardized format.
24 25 26 |
# File 'lib/skill_bench/services/judge_score_parser_service.rb', line 24 def self.call(judge_score) new(judge_score).call end |
Instance Method Details
#call ⇒ Hash
Returns { success: Boolean, response: Hash }.
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/skill_bench/services/judge_score_parser_service.rb', line 35 def call case @judge_score when String parsed = parse_string_input parsed ? { success: true, response: parsed } : error_response when Hash { success: true, response: @judge_score.transform_keys(&:to_s) } else error_response end end |