apply_guardrail
async
¶
apply_guardrail(
guardrail_identifier: GuardrailIdentifier,
guardrail_version: GuardrailVersion,
source: GuardrailContentSource,
content: GuardrailContentBlockList,
*,
config_overrides: Optional[AsyncBedrockRuntimeClientConfig] = None,
output_scope: Optional[GuardrailOutputScope] = None,
) -> ApplyGuardrailResponse
The action to apply a guardrail.
For troubleshooting some of the common errors you might encounter when using the ApplyGuardrail API, see Troubleshooting Amazon Bedrock API Error Codes in the Amazon Bedrock User Guide
Parameters:
-
guardrail_identifier(GuardrailIdentifier) –The guardrail identifier used in the request to apply the guardrail.
-
guardrail_version(GuardrailVersion) –The guardrail version used in the request to apply the guardrail.
-
source(GuardrailContentSource) –The source of data used in the request to apply the guardrail.
-
content(GuardrailContentBlockList) –The content details used in the request to apply the guardrail.
-
output_scope(Optional[GuardrailOutputScope], default:None) –Specifies the scope of the output that you get in the response. Set to
FULLto return the entire output, including any detected and non-detected entries in the response for enhanced debugging.Note that the full output scope doesn't apply to word filters or regex in sensitive information filters. It does apply to all other filtering policies, including sensitive information with filters that can detect personally identifiable information (PII).
Raises:
-
AccessDeniedException–The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error, see AccessDeniedException in the Amazon Bedrock User Guide
-
InternalServerException–An internal server error occurred. For troubleshooting this error, see InternalFailure in the Amazon Bedrock User Guide
-
ResourceNotFoundException–The specified resource ARN was not found. For troubleshooting this error, see ResourceNotFound in the Amazon Bedrock User Guide
-
ServiceQuotaExceededException–Your request exceeds the service quota for your account. You can view your quotas at Viewing service quotas. You can resubmit your request later.
-
ServiceUnavailableException–The service isn't currently available. For troubleshooting this error, see ServiceUnavailable in the Amazon Bedrock User Guide
-
ThrottlingException–Your request was denied due to exceeding the account quotas for Amazon Bedrock. For troubleshooting this error, see ThrottlingException in the Amazon Bedrock User Guide
-
ValidationException–The input fails to satisfy the constraints specified by Amazon Bedrock. For troubleshooting this error, see ValidationError in the Amazon Bedrock User Guide
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_bedrock_runtime/_services/async_bedrock_runtime.py
536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 | |