String guardrailIdentifier
The guardrail identifier used in the request to apply the guardrail.
String guardrailVersion
The guardrail version used in the request to apply the guardrail.
String source
The source of data used in the request to apply the guardrail.
List<E> content
The content details used in the request to apply the guardrail.
GuardrailUsage usage
The usage details in the response from the guardrail.
String action
The action taken in the response from the guardrail.
List<E> outputs
The output details in the response from the guardrail.
List<E> assessments
The assessment details in the response from the guardrail.
String text
Text to include in the message.
ImageBlock image
Image to include in the message.
This field is only supported by Anthropic Claude 3 models.
DocumentBlock document
A document to include in the message.
ToolResultBlock toolResult
The result for a tool request that a model makes.
GuardrailConverseContentBlock guardContent
Contains the content to assess with the guardrail. If you don't specify guardContent in a call to
the Converse API, the guardrail (if passed in the Converse API) assesses the entire message.
For more information, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide.
</p>
Long latencyMs
The latency of the call to Converse, in milliseconds.
Message message
The message that the model generates.
String modelId
The identifier for the model that you want to call.
The modelId to provide depends on the type of model that you use:
If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see Amazon Bedrock base model IDs (on-demand throughput) in the Amazon Bedrock User Guide.
If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see Run inference using a Provisioned Throughput in the Amazon Bedrock User Guide.
If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see Use a custom model in Amazon Bedrock in the Amazon Bedrock User Guide.
List<E> messages
The messages that you want to send to the model.
List<E> system
A system prompt to pass to the model.
InferenceConfiguration inferenceConfig
Inference parameters to pass to the model. Converse supports a base set of inference parameters. If
you need to pass additional parameters that the model supports, use the additionalModelRequestFields
request field.
ToolConfiguration toolConfig
Configuration information for the tools that the model can use when generating a response.
This field is only supported by Anthropic Claude 3, Cohere Command R, Cohere Command R+, and Mistral Large models.
GuardrailConfiguration guardrailConfig
Configuration information for a guardrail that you want to use in the request.
List<E> additionalModelResponseFieldPaths
Additional model parameters field paths to return in the response. Converse returns the requested
fields as a JSON Pointer object in the additionalModelResponseFields field. The following is example
JSON for additionalModelResponseFieldPaths.
[ "/stop_sequence" ]
For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation.
Converse rejects an empty JSON Pointer or incorrectly structured JSON Pointer with a
400 error code. if the JSON Pointer is valid, but the requested field is not in the model response,
it is ignored by Converse.
ConverseOutput output
The result from the call to Converse.
String stopReason
The reason why the model stopped generating output.
TokenUsage usage
The total number of tokens used in the call to Converse. The total includes the tokens input to the
model and the tokens generated by the model.
ConverseMetrics metrics
Metrics for the call to Converse.
ConverseTrace trace
A trace object that contains information about the Guardrail behavior.
GuardrailTraceAssessment guardrail
The guardrail trace object.
String format
The format of a document, or its extension.
String name
A name for the document. The name can only contain the following characters:
Alphanumeric characters
Whitespace characters (no more than one in a row)
Hyphens
Parentheses
Square brackets
This field is vulnerable to prompt injections, because the model might inadvertently interpret it as instructions. Therefore, we recommend that you specify a neutral name.
DocumentSource source
Contains the content of the document.
ByteBuffer bytes
The raw bytes for the document. If you use an Amazon Web Services SDK, you don't need to encode the bytes in base64.
GuardrailTopicPolicyAssessment topicPolicy
The topic policy.
GuardrailContentPolicyAssessment contentPolicy
The content policy.
GuardrailWordPolicyAssessment wordPolicy
The word policy.
GuardrailSensitiveInformationPolicyAssessment sensitiveInformationPolicy
The sensitive information policy.
GuardrailContextualGroundingPolicyAssessment contextualGroundingPolicy
The contextual grounding policy used for the guardrail assessment.
GuardrailTextBlock text
Text within content block to be evaluated by the guardrail.
String type
The contextual grounding filter type.
Double threshold
The threshold used by contextual grounding filter to determine whether the content is grounded or not.
Double score
The score generated by contextual grounding filter.
String action
The action performed by the guardrails contextual grounding filter.
GuardrailConverseTextBlock text
The text to guard.
String text
The specific text for the output content produced by the guardrail.
Integer topicPolicyUnits
The topic policy units processed by the guardrail.
Integer contentPolicyUnits
The content policy units processed by the guardrail.
Integer wordPolicyUnits
The word policy units processed by the guardrail.
Integer sensitiveInformationPolicyUnits
The sensitive information policy units processed by the guardrail.
Integer sensitiveInformationPolicyFreeUnits
The sensitive information policy free units processed by the guardrail.
Integer contextualGroundingPolicyUnits
The contextual grounding policy units processed by the guardrail.
String format
The format of the image.
ImageSource source
The source for the image.
ByteBuffer bytes
The raw image bytes for the image. If you use an AWS SDK, you don't need to encode the image bytes in base64.
Integer maxTokens
The maximum number of tokens to allow in the generated response. The default value is the maximum allowed value for the model that you are using. For more information, see Inference parameters for foundation models.
Float temperature
The likelihood of the model selecting higher-probability options while generating a response. A lower value makes the model more likely to choose higher-probability options, while a higher value makes the model more likely to choose lower-probability options.
The default value is the default value for the model that you are using. For more information, see Inference parameters for foundation models.
Float topP
The percentage of most-likely candidates that the model considers for the next token. For example, if you choose
a value of 0.8 for topP, the model selects from the top 80% of the probability distribution of
tokens that could be next in the sequence.
The default value is the default value for the model that you are using. For more information, see Inference parameters for foundation models.
List<E> stopSequences
A list of stop sequences. A stop sequence is a sequence of characters that causes the model to stop generating the response.
ByteBuffer body
The prompt and inference parameters in the format specified in the contentType in the header. You
must provide the body in JSON format. To see the format and content of the request and response bodies for
different models, refer to Inference parameters. For
more information, see Run
inference in the Bedrock User Guide.
String contentType
The MIME type of the input data in the request. You must specify application/json.
String accept
The desired MIME type of the inference body in the response. The default value is application/json.
String modelId
The unique identifier of the model to invoke to run inference.
The modelId to provide depends on the type of model that you use:
If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see Amazon Bedrock base model IDs (on-demand throughput) in the Amazon Bedrock User Guide.
If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see Run inference using a Provisioned Throughput in the Amazon Bedrock User Guide.
If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see Use a custom model in Amazon Bedrock in the Amazon Bedrock User Guide.
String trace
Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.
String guardrailIdentifier
The unique identifier of the guardrail that you want to use. If you don't provide a value, no guardrail is applied to the invocation.
An error will be thrown in the following situations.
You don't provide a guardrail identifier but you specify the amazon-bedrock-guardrailConfig field in
the request body.
You enable the guardrail but the contentType isn't application/json.
You provide a guardrail identifier, but guardrailVersion isn't specified.
String guardrailVersion
The version number for the guardrail. The value can also be DRAFT.
ByteBuffer body
Inference response from the model in the format specified in the contentType header. To see the
format and content of the request and response bodies for different models, refer to Inference parameters.
String contentType
The MIME type of the inference result.
String role
The role that the message plays in the message.
List<E> content
The message content. Note the following restrictions:
You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.
You can include up to five documents. Each document's size must be no more than 4.5 MB.
If you include a ContentBlock with a document field in the array, you must also include
a ContentBlock with a text field.
You can only include images and documents if the role is user.
String name
The name of the tool that the model must request.
String text
A system prompt for the model.
GuardrailConverseContentBlock guardContent
A content block to assess with the guardrail. Use with the Converse or ConverseStream API operations.
For more information, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide.
ToolSpecification toolSpec
The specfication for the tool.
AutoToolChoice auto
(Default). The Model automatically decides if a tool should be called or whether to generate text instead.
AnyToolChoice any
The model must request at least one tool (no text is generated).
SpecificToolChoice tool
The Model must request the specified tool. Only supported by Anthropic Claude 3 models.
List<E> tools
An array of tools that you want to pass to a model.
ToolChoice toolChoice
If supported by model, forces the model to request a tool.
String text
A tool result that is text.
ImageBlock image
A tool result that is an image.
This field is only supported by Anthropic Claude 3 models.
DocumentBlock document
A tool result that is a document.
String name
The name for the tool.
String description
The description for the tool.
ToolInputSchema inputSchema
The input schema for the tool in JSON format.
Copyright © 2024. All rights reserved.