Class AiResponseParser
java.lang.Object
io.jenkins.plugins.changeinvestigator.ai.AiResponseParser
Parses the model's chat-completion message content into an
AiAssessment.
Models frequently do not follow "JSON only" instructions perfectly - they wrap the JSON
in markdown code fences, add a sentence before/after it, or occasionally omit a field. This
parser is deliberately tolerant of all of that; a parsing problem must never propagate as an
exception that could disrupt a build. Any input this cannot make sense of results in a
AiAnalysisException with kind MALFORMED_RESPONSE, which the caller turns into
a visible "AI unavailable" state rather than a mysterious failure.
-
Constructor Summary
ConstructorsConstructorDescriptionAiResponseParser(com.fasterxml.jackson.databind.ObjectMapper objectMapper, String providerUsed, String modelUsed) -
Method Summary
-
Constructor Details
-
AiResponseParser
-
-
Method Details
-
parse
- Throws:
AiAnalysisException
-