Skip to content

BedrockRuntimeClient.invoke_guardrail_checks

rboto-bedrock-runtime==0.4.0 · Service index · Types

Model summary (excerpt): Evaluates messages against inline guardrail checks. You specify the check configurations directly in the request, and Amazon Bedrock returns per-check results with severity or confidence scores.

Install and imports

python -m pip install "rboto[bedrock-runtime]==0.4.0"
from rboto import BedrockRuntimeClient
from collections.abc import Sequence
from rboto_bedrock_runtime.types import (
    GuardrailChecksConfig,
    GuardrailChecksMessage,
    InvokeGuardrailChecksOutput,
)

Signature

async def invoke_guardrail_checks(
    *,
    messages: Sequence[GuardrailChecksMessage],
    checks: GuardrailChecksConfig,
) -> InvokeGuardrailChecksOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
messages Yes The messages to evaluate against the specified guardrail checks. Each message includes a role and one or more content blocks.
checks Yes The inline check configurations that specify which guardrail checks to run against the messages.

Output

InvokeGuardrailChecksOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
results GuardrailChecksResultsOutput | None Always present GuardrailChecksResultsOutput
usage GuardrailChecksUsageResultsOutput | None Always present GuardrailChecksUsageResultsOutput

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

GuardrailChecksConfig, GuardrailChecksMessage, InvokeGuardrailChecksOutput

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

Import from rboto_bedrock_runtime.exceptions:

AccessDeniedError, InternalServerError, ServiceUnavailableError, ThrottlingError, ValidationError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model