View a markdown version of this page

배치 평가 결과 가져오기 - Amazon Bedrock AgentCore

배치 평가 결과 가져오기

배치 평가 작업의 상태 및 결과를 검색합니다. 작업이 터미널 상태(COMPLETED, FAILED또는 )에 도달할 때까지이 작업을 폴링합니다STOPPED.

코드 샘플

AgentCore CLI

--wait 플래그는 동작 방식을 제어agentcore run batch-evaluation합니다.

  • 의 경우--wait: 명령은 작업이 터미널 상태에 도달할 때까지 차단합니다.

  • 없는 경우--wait: 명령이 작업을 시작하고 즉시 반환합니다. 상태를 개별적으로 폴링합니다.

    # Start a job and block until it reaches a terminal state agentcore run batch-evaluation -r MyAgent -e Builtin.Correctness --wait # List previously started jobs (running jobs are refreshed from the service) agentcore batch-evaluations history # Check the status and results of a single job agentcore view batch-evaluation <batch-evaluation-id> # Non-interactive (JSON) output, the CLI analogue of a get_batch_evaluation polling loop agentcore view batch-evaluation <batch-evaluation-id> --json # Stop a running job agentcore stop batch-evaluation -i <batch-evaluation-id>

    agentcore run batch-evaluation 또는 agentcore batch-evaluations history 목록의 CLI 출력에서 배치 평가 ID를 사용합니다.

AWS SDK (boto3)
import time import boto3 client = boto3.client("bedrock-agentcore", region_name="us-west-2") # Poll until terminal state while True: result = client.get_batch_evaluation(batchEvaluationId=batch_eval_id) status = result["status"] print(f"Status: {status}") if status in ("COMPLETED", "COMPLETED_WITH_ERRORS", "FAILED", "STOPPED"): break time.sleep(30) # Display results if result.get("evaluationResults"): er = result["evaluationResults"] print(f"Sessions completed: {er.get('numberOfSessionsCompleted', 0)}") print(f"Sessions failed: {er.get('numberOfSessionsFailed', 0)}") print(f"Total sessions: {er.get('totalNumberOfSessions', 0)}") for summary in er.get("evaluatorSummaries", []): avg = summary.get("statistics", {}).get("averageScore") print(f" {summary['evaluatorId']}: {avg}")

요청 파라미터

파라미터 유형 필수 설명

batchEvaluationId

문자열

에서 반환한 배치 평가 ID입니다StartBatchEvaluation. 경로 파라미터로 전달됩니다.

응답

Field 유형 설명

batchEvaluationId

문자열

배치 평가 ID입니다.

batchEvaluationArn

문자열

배치 평가의 ARN입니다.

batchEvaluationName

문자열

작업 이름입니다.

status

문자열

현재 상태: PENDING, IN_PROGRESS, COMPLETED, COMPLETED_WITH_ERRORS, FAILED, STOPPING, , STOPPED. DELETING

createdAt

타임스탬프

작업이 생성된 시간입니다.

evaluators

List

사용된 평가자입니다.

outputConfig

객체

세션별 세부 정보를 위한 CloudWatch Logs 대상입니다. cloudWatchConfig.logGroupName 및를 포함합니다cloudWatchConfig.logStreamName.

evaluationResults

객체

작업에서 세션을 처리했을 때 표시됩니다. 결과 및 출력 이해를 참조하세요.

errorDetails

문자열 목록

작업이 실패한 경우 오류 메시지입니다.

evaluationResults 필드

Field 유형 설명

numberOfSessionsCompleted

Integer

성공적으로 평가된 세션 수입니다.

numberOfSessionsFailed

Integer

평가에 실패한 세션 수입니다.

numberOfSessionsInProgress

Integer

아직 평가 중인 세션 수입니다.

totalNumberOfSessions

Integer

검색된 총 세션 수입니다.

numberOfSessionsIgnored

Integer

평가를 위해 무시된 세션 수입니다. 서비스는 작업당 최대 500개의 세션을 평가합니다. 더 많은 세션이 검색되면 가장 최근 500개가 선택됩니다.

evaluatorSummaries

List

평가자별 집계 결과.

evaluatorSummaries 필드

Field 유형 설명

evaluatorId

문자열

평가자 ID(예: Builtin.GoalSuccessRate).

statistics.averageScore

배정밀도 실수

평가된 모든 세션의 평균 점수입니다.

totalEvaluated

Integer

이 평가자의 점수가 매겨진 세션 수입니다.

totalFailed

Integer

이 평가기가 실패한 세션 수입니다.

상태 수명 주기

PENDING → IN_PROGRESS → COMPLETED
                      → COMPLETED_WITH_ERRORS
                      → FAILED
         STOPPING     → STOPPED
         DELETING
  • 대기 중 - 작업이 수락되었으며 처리를 위해 대기열에 있습니다.

  • IN_PROGRESS - 서비스가 세션을 검색하고 평가자를 실행 중입니다.

  • COMPLETED - 모든 세션이 평가되었습니다. 결과를 사용할 수 있습니다.

  • COMPLETED_WITH_ERRORS - 작업이 완료되었지만 일부 세션에서 오류가 발생했습니다. 부분 결과를 사용할 수 있습니다.

  • FAILED - 작업에 오류가 발생했습니다. errorDetails 세부 정보를 확인합니다.

  • 중지 중 - 중지 요청이 수신되었습니다. 작업이 중단되고 있습니다.

  • 중지됨 - 작업이 완료되기 전에 중지되었습니다. 부분 결과를 사용할 수 있습니다.

  • 삭제 중 - 작업이 삭제되고 있습니다.

오류

오류 HTTP 상태 설명

ResourceNotFoundException

404

지정된 ID로 배치 평가를 찾을 수 없습니다.

ValidationException

400

배치 평가 ID 형식이 잘못되었습니다.

AccessDeniedException

403

권한이 부족합니다.

ThrottlingException

429

요청 속도가 초과되었습니다.

InternalServerException

500

서비스 측 오류입니다.