invoke_guardrail_checks¶
Operation¶
invoke_guardrail_checks
¶
invoke_guardrail_checks(request: InvokeGuardrailChecksInput | InvokeGuardrailChecksInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[InvokeGuardrailChecksInputDict]) -> InvokeGuardrailChecksOutput
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.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
InvokeGuardrailChecksInput | InvokeGuardrailChecksInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
**kwargs
|
Unpack[InvokeGuardrailChecksInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
InvokeGuardrailChecksOutput
|
An instance of |
invoke_guardrail_checks
async
¶
invoke_guardrail_checks(request: InvokeGuardrailChecksInput | InvokeGuardrailChecksInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[InvokeGuardrailChecksInputDict]) -> InvokeGuardrailChecksOutput
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.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
InvokeGuardrailChecksInput | InvokeGuardrailChecksInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
**kwargs
|
Unpack[InvokeGuardrailChecksInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
InvokeGuardrailChecksOutput
|
An instance of |
Input¶
Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.
InvokeGuardrailChecksInputDict
¶
Bases: TypedDict
Dictionary form of InvokeGuardrailChecksInput.
Attributes¶
checks
instance-attribute
¶
The inline check configurations that specify which guardrail checks to run against the messages.
messages
instance-attribute
¶
messages: Required[Sequence[GuardrailChecksMessage | GuardrailChecksMessageDict]]
The messages to evaluate against the specified guardrail checks. Each message includes a role and one or more content blocks.
InvokeGuardrailChecksInput
dataclass
¶
Bases: _SerdeShape
Dataclass for InvokeGuardrailChecksInput structure.
Attributes¶
checks
class-attribute
instance-attribute
¶
checks: GuardrailChecksConfig | None = ...
The inline check configurations that specify which guardrail checks to run against the messages.
messages
class-attribute
instance-attribute
¶
messages: list[GuardrailChecksMessage] | None = ...
The messages to evaluate against the specified guardrail checks. Each message includes a role and one or more content blocks.
Output¶
InvokeGuardrailChecksOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for InvokeGuardrailChecksOutput structure.
Attributes¶
response_metadata
class-attribute
instance-attribute
¶
Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.
results
instance-attribute
¶
results: GuardrailChecksResults
The per-check results containing findings from the guardrail evaluation.
usage
instance-attribute
¶
usage: GuardrailChecksUsageResults
The per-check text unit consumption for the guardrail evaluation.