MCPcopy Create free account
hub / github.com/crewAIInc/crewAI / _classify_route

Function _classify_route

scripts/jev_evaluation_runner.py:490–509  ·  view source on GitHub ↗
(
    record: RouteRecord, known_routes: set[str], min_confidence: float
)

Source from the content-addressed store, hash-verified

488
489
490def _classify_route(
491 record: RouteRecord, known_routes: set[str], min_confidence: float
492) -> tuple[Outcome, str]:
493 decision, reason = _parse_decision(record, ChoiceDecision)
494 if not isinstance(decision, ChoiceDecision):
495 return "failed", reason
496 if decision.choice not in known_routes:
497 return "failed", f"choice {decision.choice!r} is not a known route"
498 if decision.confidence < min_confidence:
499 return (
500 "abstained",
501 f"confidence {decision.confidence} below min_confidence {min_confidence}",
502 )
503 outcome: Outcome = (
504 "correct" if decision.choice == record.expected_route else "incorrect"
505 )
506 return (
507 outcome,
508 f"confidence {decision.confidence} meets min_confidence {min_confidence}",
509 )
510
511
512def _classify_guardrail(

Callers 1

evaluateFunction · 0.85

Calls 1

_parse_decisionFunction · 0.85

Tested by

no test coverage detected