Repository navigation
feat(tools): add Jev Score questions - #9273
Amy Chang (chang-amy) wants to merge 14 commits into
Conversation
Add JevScoreTool, which rates state against one ordered TypeSafe Jev Score rubric using the SDK's Score type and returns the expected score, per-level probabilities, confidence, and legend, plus model and usage metadata when available. The score is passed through as the SDK's probability-weighted value and is never treated as a pass/fail flag; success only reports whether a usable answer came back. Missing answers, invalid input, and SDK errors return an explicit failure instead of a fabricated score. Part of crewAIInc#8122. Stacked on crewAIInc#8076. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add the standard Description, Installation, Example, and Arguments sections, and recommend installing the package's typesafe-sdk extra with `uv add "crewai-tools[typesafe-sdk]"`. The missing-SDK error message and its test use the same command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A System One response whose `scores` is None made JevScoreTool fail with "'NoneType' object has no attribute 'get'". Treat it like an empty mapping so the tool reports that no Score answer was returned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Strix Security ReviewWarning This pull request has 129 commits after the last Strix review ( ✅ No open security findings. PR summary: Adds a `JevScoreTool` that rates task state against an ordered TypeSafe Jev Score rubric and returns the expected score, per-level probabilities, confidence and legend, alongside the stacked `JevDecisionTool`; both are exported from `crewai_tools` and gated behind a new optional `typesafe-sdk` extra. Review summaryReviewed the new Ruled out (4)
Review 1 on this PR · Reviewed by Strix |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7bca0ab. Configure here.
Co-authored-by: Cursor <cursoragent@cursor.com>

Related issue
Fixes #8122
Stacked on #8076 (Jev Choice tool). Until #8076 merges, this diff also shows its commits. The Score changes are the last three commits:
93616d6b6,d48a37bb3, and47633e470.Summary
Adds
JevScoreTool, which rates state against one ordered TypeSafe Jev Score rubric.state,question, andcriteria, an ordered list of level descriptions with the lowest first. A level's position is its score, starting at 0. This mirrors the Choice tool'sstate/question/choicesshape.Scoretype rather than a parallel schema. The tool adds only the checks the SDK does not make: it rejects an empty level list, blank orNonelevels, and a blank question.{"success": True, "score", "probabilities", "confidence", "legend"}, plusmodelandusagewhen the response includes them.scoreis the SDK's probability-weighted expected score, passed through unchanged, so it can fall between levels.successonly reports whether a usable answer came back. It is never a pass/fail verdict on the score.scoresbeingNone), an answer without a score, invalid input, a missing SDK, and SDK errors all return{"success": False, "error": ...}instead of a made-up score.JevScoreToolis available fromcrewai_toolsandcrewai_tools.tools. TheJevDecisionToolimport moves only because ruff sorts imports.uv add "crewai-tools[typesafe-sdk]". The missing-SDK error message gives the same command.Choice tool behaviour is unchanged.
Verification
Tests added or updated for the changed behavior
Relevant tests and quality checks pass locally
uv run pytest tests/tools/jev_score_tool_test.py tests/tools/jev_decision_tool_test.py: all pass. Score tests use a fake SDK module and mock client, so they make no paid API calls. They cover returned scores, ordered criteria sent as an SDKScore, fractional scores reported as-is, missing answers, invalid input that never reaches the SDK, SDK failure, and a missing dependency.One test round-trips a real
typesafe_sdk.SystemOneResponsethrough the tool when the SDK is installed. It ran locally againsttypesafe-sdk0.7.x.ruff check,ruff format --check, andmypy(strict) are clean on the new files.Additional context
crewai-tools[typesafe-sdk]extra, while the Choice tool still saysuv add --optional typesafe-sdk typesafe-sdk. Happy to align them once feat(tools): add jev decision tool #8076 lands.🤖 Generated with Claude Code
Note
Low Risk
Isolated new optional tools behind an extra; behavior is guarded by validation, structured error returns, and tests, with no changes to existing tool logic beyond exports and lockfile.
Overview
Adds a
typesafe-sdkoptional extra (crewai-tools[typesafe-sdk]) and wiresJevDecisionToolandJevScoreToolinto the publiccrewai_toolsexports. Both tools call TypeSafe System One withTYPESAFE_*env vars, validate inputs locally, and return structured{success, error, …}payloads (choice label + probabilities, or expected score + level probabilities/legend).JevScoreToolis the primary feature here: it builds an SDKScorequestion fromstate/question/ orderedcriteria, passes through the SDK’s fractional expected score without treating it as pass/fail, and surfaces API failures and missing answers explicitly.JevDecisionToolmirrors the same pattern for labeled Choice questions. Each ships with a README and pytest coverage (mocked client plus optional real SDK round-trip for score).uv.lockis updated fortypesafe-sdkand its HTTP stack dependencies.Reviewed by Cursor Bugbot for commit d586493. Bugbot is set up for automated code reviews on this repo. Configure here.