/AWS1/IF_BDK=>CREAUTOMATEDRSNINGPLYTSTCASE()
¶
About CreateAutomatedReasoningPolicyTestCase¶
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.
Method Signature¶
IMPORTING¶
Required arguments:¶
iv_policyarn
TYPE /AWS1/BDKAUTOMATEDRSNINGPLYARN
/AWS1/BDKAUTOMATEDRSNINGPLYARN
¶
The Amazon Resource Name (ARN) of the Automated Reasoning policy for which to create the test.
iv_guardcontent
TYPE /AWS1/BDKAUTOMATEDRSNINGPLYT00
/AWS1/BDKAUTOMATEDRSNINGPLYT00
¶
The output content that's validated by the Automated Reasoning policy. This represents the foundation model response that will be checked for accuracy.
iv_expectedaggdfndgsresult
TYPE /AWS1/BDKAUTOMATEDRSNINGCHEC00
/AWS1/BDKAUTOMATEDRSNINGCHEC00
¶
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_TRANSLATIONS
finding. You might also see aNO_TRANSLATIONS
(along with other findings) if some part of the validation isn't translated.
Optional arguments:¶
iv_querycontent
TYPE /AWS1/BDKAUTOMATEDRSNINGPLYT01
/AWS1/BDKAUTOMATEDRSNINGPLYT01
¶
The input query or prompt that generated the content. This provides context for the validation.
iv_clientrequesttoken
TYPE /AWS1/BDKIDEMPOTENCYTOKEN
/AWS1/BDKIDEMPOTENCYTOKEN
¶
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.
iv_confidencethreshold
TYPE /AWS1/RT_DOUBLE_AS_STRING
/AWS1/RT_DOUBLE_AS_STRING
¶
The minimum confidence level for logic validation. Content that meets the threshold is considered a high-confidence finding that can be validated.
RETURNING¶
oo_output
TYPE REF TO /aws1/cl_bdkcreautomatedrsni01
/AWS1/CL_BDKCREAUTOMATEDRSNI01
¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->/aws1/if_bdk~creautomatedrsningplytstcase(
iv_clientrequesttoken = |string|
iv_confidencethreshold = |0.1|
iv_expectedaggdfndgsresult = |string|
iv_guardcontent = |string|
iv_policyarn = |string|
iv_querycontent = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_automatedreasoningpolic = lo_result->get_policyarn( ).
lv_automatedreasoningpolic_1 = lo_result->get_testcaseid( ).
ENDIF.