Class AiResponseParser

java.lang.Object
io.jenkins.plugins.changeinvestigator.ai.AiResponseParser

public final class AiResponseParser extends Object
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.