create_automated_reasoning_policy_test_case
async
¶
create_automated_reasoning_policy_test_case(
policy_arn: AutomatedReasoningPolicyArn,
guard_content: AutomatedReasoningPolicyTestGuardContent,
expected_aggregated_findings_result: AutomatedReasoningCheckResult,
*,
config_overrides: Optional[AsyncBedrockClientConfig] = None,
query_content: Optional[AutomatedReasoningPolicyTestQueryContent] = None,
client_request_token: Optional[IdempotencyToken] = None,
confidence_threshold: Optional[AutomatedReasoningCheckTranslationConfidence] = None,
) -> CreateAutomatedReasoningPolicyTestCaseResponse
Creates a test for an Automated Reasoning policy. Tests validate that your policy works as expected by providing sample inputs and expected outcomes. Use tests to verify policy behavior before deploying to production.
Parameters:
-
policy_arn(AutomatedReasoningPolicyArn) –The Amazon Resource Name (ARN) of the Automated Reasoning policy for which to create the test.
-
guard_content(AutomatedReasoningPolicyTestGuardContent) –The output content that's validated by the Automated Reasoning policy. This represents the foundation model response that will be checked for accuracy.
-
query_content(Optional[AutomatedReasoningPolicyTestQueryContent], default:None) –The input query or prompt that generated the content. This provides context for the validation.
-
expected_aggregated_findings_result(AutomatedReasoningCheckResult) –The expected result of the Automated Reasoning check. Valid values include: , TOO_COMPLEX, and NO_TRANSLATIONS.
-
VALID- The claims are true. The claims are implied by the premises and the Automated Reasoning policy. Given the Automated Reasoning policy and premises, it is not possible for these claims to be false. In other words, there are no alternative answers that are true that contradict the claims. -
INVALID- The claims are false. The claims are not implied by the premises and Automated Reasoning policy. Furthermore, there exists different claims that are consistent with the premises and Automated Reasoning policy. -
SATISFIABLE- The claims can be true or false. It depends on what assumptions are made for the claim to be implied from the premises and Automated Reasoning policy rules. In this situation, different assumptions can make input claims false and alternative claims true. -
IMPOSSIBLE- Automated Reasoning can’t make a statement about the claims. This can happen if the premises are logically incorrect, or if there is a conflict within the Automated Reasoning policy itself. -
TRANSLATION_AMBIGUOUS- Detected an ambiguity in the translation meant it would be unsound to continue with validity checking. Additional context or follow-up questions might be needed to get translation to succeed. -
TOO_COMPLEX- The input contains too much information for Automated Reasoning to process within its latency limits. -
NO_TRANSLATIONS- Identifies that some or all of the input prompt wasn't translated into logic. This can happen if the input isn't relevant to the Automated Reasoning policy, or if the policy doesn't have variables to model relevant input. If Automated Reasoning can't translate anything, you get a singleNO_TRANSLATIONSfinding. You might also see aNO_TRANSLATIONS(along with other findings) if some part of the validation isn't translated.
-
-
client_request_token(Optional[IdempotencyToken], default:None) –A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error.
-
confidence_threshold(Optional[AutomatedReasoningCheckTranslationConfidence], default:None) –The minimum confidence level for logic validation. Content that meets the threshold is considered a high-confidence finding that can be validated.
Raises:
-
AccessDeniedException–The request is denied because of missing access permissions.
-
ConflictException–Error occurred because of a conflict while performing an operation.
-
InternalServerException–An internal server error occurred. Retry your request.
-
ResourceNotFoundException–The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
-
ServiceQuotaExceededException–The number of requests exceeds the service quota. Resubmit your request later.
-
ThrottlingException–The number of requests exceeds the limit. Resubmit your request later.
-
ValidationException–Input validation failed. Check your request parameters and retry the request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_bedrock/_services/async_bedrock.py
1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 | |