Spot the bug in the response parser

from LLM application basics
Node 24 intermediate 4 min 3 issues to find

Find the failure paths in this generated response parser.

JavaScript
function acceptModelReply(raw) {
  const result = JSON.parse(raw);
  if (result.confidence > 0.7) {
    return QUEUES[result.category];
  }
  return "manual-review";
}

const route = acceptModelReply(modelResponse.text);
dispatchTicket(route);
Open in playground
Report an error