Repository navigation
feat(evaluation): evaluate existing sessions and add RecommendationClient - #708
Conversation
…ient Add BatchEvaluationRunner.run_session_evaluation to score sessions already in CloudWatch without invoking the agent, and RecommendationClient with start_recommendation_and_wait for system prompt and tool description recommendations.
✅ No Breaking Changes DetectedNo public API breaking changes found in this PR. |
|
Claude Security Review: no high-confidence findings. (run) |
jariy17
left a comment
There was a problem hiding this comment.
Two comments. RecommendationClient looks good. The one I care about is run_session_evaluation: I think it belongs on EvaluationClient with the batch APIs added to its allowlist, rather than on BatchEvaluationRunner, which exists for dataset runs. The other is a minor ordering nit.
Allowlist the batch evaluation APIs on EvaluationClient and add start_batch_evaluation_and_wait. Revert run_session_evaluation from BatchEvaluationRunner, which is for dataset runs. wait_until accepts a set of target statuses.
|
Thanks, moved it. EvaluationClient now allowlists the five batch APIs and has start_batch_evaluation_and_wait, and the runner is back to main, so the ordering nit goes away with it. wait_until now also accepts a set of target statuses, since a batch evaluation can finish as COMPLETED or COMPLETED_WITH_ERRORS. The sessionIds fix stays. Verified live on two existing runtime sessions with GoalSuccessRate and FailureAnalysis. |
|
Claude Security Review: no high-confidence findings. (run) |
Adds two small pieces for working with agents that already run on AgentCore Runtime. Both are framework agnostic.
EvaluationClientnow allowlists the batch evaluation APIs (start, get, list, stop, delete) and addsstart_batch_evaluation_and_wait, which scores sessions already in CloudWatch without invoking the agent. Scores come back underevaluationResultsandBuiltin.FailureAnalysisinsights underinsightResults.wait_untilnow accepts a set of target statuses so a run that ends asCOMPLETED_WITH_ERRORSreturns instead of timing out.RecommendationClientpasses through the four recommendation APIs (allowlisted, accepts snake_case kwargs) and addsstart_recommendation_and_wait. It follows the same pattern asDatasetClient.CloudWatchDataSourceConfig.to_data_source_configomitssessionIdswhen the list is empty, since an empty list filters to nothing.Testing: unit tests added. The full suite passes (3621 passed). Tested live in us-west-2: GoalSuccessRate and FailureAnalysis ran over 2 existing runtime sessions in 102 s and returned 2 insight results, and a recommendation from a batch evaluation completed in 123 s.