put_experiment_run_results
async
¶
put_experiment_run_results(
experiment_id: ExperimentId,
run_id: ExperimentRunId,
results: ExperimentCaseResultList,
*,
config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
client_token: Optional[ClientToken] = None,
run: Optional[ReportedRunInfo] = None,
) -> PutExperimentRunResultsOutput
Reports a batch of scored cases for a run. Applies to runs reported from the caller's code (REPORTED runs). Each call reports up to 25 cases. The first call with a new runId creates the run and must include the run block. Repeat the call to report more cases, then call CompleteExperimentRun to end the run. Fails with a ConflictException (RUN_TERMINAL) for a run that has ended, and (RUN_ID_DELETED) for the runId of a deleted run. The batch is atomic: an invalid item fails the whole request with a ValidationException that names the item and field (for example, results[3].caseId), and nothing is written. A request is at most 1 MB, and each results item at most 256 KB as canonical JSON. A larger item fails with a ValidationException, and a larger request is rejected before it reaches the API.
Parameters:
-
experiment_id(ExperimentId) –The ID of the experiment the run belongs to.
-
run_id(ExperimentRunId) –The ID of the run, chosen by the caller. A runId that is new to the experiment creates a run. A call that fails validation does not create the run.
-
client_token(Optional[ClientToken], default:None) –Idempotency token for safe retries. Repeated requests with the same token and identical input return the recorded response. A call that fails validation frees the token, so the corrected batch can be resent with the same token.
-
run(Optional[ReportedRunInfo], default:None) –The details of the run. Required on the call that creates the run; optional afterwards, and must match the run when present.
-
results(ExperimentCaseResultList) –The cases to report: up to 25 distinct cases, written atomically so that all are accepted or none are. Each item is at most 256 KB as canonical JSON.
Raises:
-
AccessDeniedException–The caller is not authorized to perform this action.
-
ConflictException–The operation could not be completed because of a conflict with the current state of the resource.
-
InternalServerException–An unexpected error occurred while processing the request.
-
ResourceNotFoundException–The specified resource does not exist.
-
ServiceQuotaExceededException–A service quota was exceeded.
-
ThrottlingException–The request was throttled due to exceeding the allowed request rate.
-
ValidationException–A parameter is specified incorrectly.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Create a reported run and report its first cases The following example creates a run reported from the caller's code and reports two cases: one the agent answered, and one where the agent could not be invoked. Payloads are shown as JSON; on the wire they are CBOR-encoded.
>>> await client.put_experiment_run_results(experiment_id='exp-01JD8K3M5N7P9Q2R4S6T8V0W1X', run_id='ci-build-4821', client_token='ci-build-4821-batch-1', run={'producer': {'kind': 'CUSTOM', 'name': 'release-eval-harness', 'version': '1.4.0', 'externalId': '4821'}, 'evaluators': [{'evaluatorId': 'Builtin.Helpfulness', 'ratingScale': 'NUMERIC'}], 'rule': {'source': 'FILE', 'name': 'release-gate', 'caseCriteria': [{'evaluator': {'evaluatorId': 'Builtin.Helpfulness', 'threshold': {'minScore': 0.7}}}], 'gates': [{'metric': {'passRate': {}}, 'bound': {'min': 0.9}}]}, 'target': {'agentCoreRuntime': {'endpointArn': 'arn:aws:bedrock-agentcore:us-east-1:123456789012:runtime/support_agent-a1B2c3D4e5/runtime-endpoint/production', 'version': '7'}}, 'dataset': {'source': 'FILE', 'name': 'support-faq.jsonl', 'caseCount': 50}, 'metadata': {'gitCommit': '4f9c2e1'}, 'startedAt': '2026-11-10T15:01:58Z'}, results=[{'caseId': 'faq-001', 'sessionId': 'ci-build-4821-faq-001', 'executionStatus': 'COMPLETED', 'turns': [{'traceId': '6f1c2a9e4b7d3f08a5c1e9b2d4f6a8c0', 'input': 'How do I reset my password?', 'output': 'Choose Forgot password on the sign-in page and follow the link that we email you.'}], 'evaluators': [{'evaluatorId': 'Builtin.Helpfulness', 'score': 0.86}]}, {'caseId': 'faq-002', 'executionStatus': 'TARGET_ERROR', 'statusReason': 'TARGET_INVOKE_ERROR', 'turns': [{'input': 'Can I change the email on my account?'}]}])
Source code in docs_src/capo_cloudwatchomni/_services/async_cloud_watch_omni.py
7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 | |