Values.ConverseResponseSourceSends messages to the specified Amazon Bedrock model. Converse provides a consistent interface that works with all models that support messages. This allows you to write code once and use it with different models. If a model has unique inference parameters, you can also pass those unique parameters to the model. Amazon Bedrock doesn't store any text, images, or documents that you provide as content. The data is only used to generate the response. You can submit a prompt by including it in the messages field, specifying the modelId of a foundation model or inference profile to run inference on it, and including any other fields that are relevant to your use case. You can also submit a prompt from Prompt management by specifying the ARN of the prompt version and including a map of variables to values in the promptVariables field. You can append more messages to the prompt by using the messages field. If you use a prompt from Prompt management, you can't include the following fields in the request: additionalModelRequestFields, inferenceConfig, system, or toolConfig. Instead, these fields must be defined through Prompt management. For more information, see Use a prompt from Prompt management. For information about the Converse API, see Use the Converse API in the Amazon Bedrock User Guide. To use a guardrail, see Use a guardrail with the Converse API in the Amazon Bedrock User Guide. To use a tool with a model, see Tool use (Function calling) in the Amazon Bedrock User Guide For example code, see Converse API examples in the Amazon Bedrock User Guide. This operation requires permission for the bedrock:InvokeModel action. To deny all inference access to resources that you specify in the modelId field, you need to deny access to the bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream actions. Doing this also denies access to the resource through the base inference actions (InvokeModel and InvokeModelWithResponseStream). For more information see Deny access for inference on specific models. For troubleshooting some of the common errors you might encounter when using the Converse API, see Troubleshooting Amazon Bedrock API Error Codes in the Amazon Bedrock User Guide
type nonrec t = {output : ConverseOutput.t option;The result from the call to Converse.
*)stopReason : StopReason.t option;The reason why the model stopped generating output.
*)usage : TokenUsage.t option;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.
*)metrics : ConverseMetrics.t option;Metrics for the call to Converse.
*)additionalModelResponseFields : Document.t option;Additional fields in the response that are unique to the model.
*)trace : ConverseTrace.t option;A trace object that contains information about the Guardrail behavior.
*)performanceConfig : PerformanceConfiguration.t option;Model performance settings for the request.
*)serviceTier : ServiceTier.t option;Specifies the processing tier configuration used for serving the request.
*)}type nonrec error = [ | `AccessDeniedException of AccessDeniedException.t| `InternalServerException of InternalServerException.t| `ModelErrorException of ModelErrorException.t| `ModelNotReadyException of ModelNotReadyException.t| `ModelTimeoutException of ModelTimeoutException.t| `ResourceNotFoundException of ResourceNotFoundException.t| `ThrottlingException of ThrottlingException.t| `ValidationException of ValidationException.t| `Unknown_operation_error of string * string option ]val error_of_json :
string ->
Yojson.Safe.t ->
[> `AccessDeniedException of AccessDeniedException.t
| `InternalServerException of InternalServerException.t
| `ModelErrorException of ModelErrorException.t
| `ModelNotReadyException of ModelNotReadyException.t
| `ModelTimeoutException of ModelTimeoutException.t
| `ResourceNotFoundException of ResourceNotFoundException.t
| `ServiceUnavailableException of ServiceUnavailableException.t
| `ThrottlingException of ThrottlingException.t
| `Unknown_operation_error of string * string option
| `ValidationException of ValidationException.t ]val error_of_xml :
string ->
Awso.Xml.t ->
[> `AccessDeniedException of AccessDeniedException.t
| `InternalServerException of InternalServerException.t
| `ModelErrorException of ModelErrorException.t
| `ModelNotReadyException of ModelNotReadyException.t
| `ModelTimeoutException of ModelTimeoutException.t
| `ResourceNotFoundException of ResourceNotFoundException.t
| `ServiceUnavailableException of ServiceUnavailableException.t
| `ThrottlingException of ThrottlingException.t
| `Unknown_operation_error of string * string option
| `ValidationException of ValidationException.t ]val to_value :
t ->
[> `Structure of
(string
* [> `Enum of string
| `Structure of
(string
* [> `Enum of string
| `Integer of TokenUsageInputTokensInteger.t
| `List of
[> `Structure of
(string
* [> `Enum of string
| `Integer of CacheDetailInputTokensInteger.t ])
list ]
list
| `Long of Long.t
| `Structure of
(string
* [> `Enum of string
| `List of
[> `String of GuardrailOutputText.t
| `Structure of
(string
* [> `String of String_.t
| `Structure of
(string
* [> `Blob of Blob.t
| `Enum of string
| `List of
[> `Structure of
(string
* [> `List of
[> `Structure of
(string
* [> `String of String_.t ])
list ]
list
| `String of String_.t
| `Structure of
(string
* [> `Enum of string
| `List of
[> `Structure of
(string
* [> `String of
String_.t ])
list ]
list
| `String of
DocumentBlockNameString.t
| `Structure of
(string
* [> `Blob of
ImageSourceBytesBlob.t
| `Boolean of Boolean.t
| `Integer of
DocumentCharLocationDocumentIndexInteger.t
| `List of
[> `Structure of
(string
* [> `String of
String_.t ])
list ]
list
| `String of String_.t
| `Structure of
(string
* [> `String of S3Uri.t ])
list ])
list ])
list ])
list ]
list
| `String of DocumentBlockNameString.t
| `Structure of
(string
* [> `Blob of ImageSourceBytesBlob.t
| `Boolean of Boolean.t
| `Enum of string
| `List of
[> `Enum of string
| `Structure of
(string * [> `String of String_.t ])
list ]
list
| `String of String_.t
| `Structure of
(string
* [> `Blob of
GuardrailConverseImageSourceBytesBlob.t
| `String of S3Uri.t ])
list ])
list ])
list ])
list ]
list
| `Map of
([> `String of String_.t ]
* [> `List of
[> `Structure of
(string
* [> `Structure of
(string
* [> `Enum of string
| `List of
[> `Enum of string
| `Structure of
(string
* [> `Boolean of Boolean.t
| `Double of
GuardrailContextualGroundingFilterThresholdDouble.t
| `Enum of string
| `String of String_.t
| `Structure of
(string
* [> `List of
[> `Structure of
(string
*
[>
`List of
[>
`Structure of
(string
*
[>
`Double of
GuardrailAutomatedReasoningTranslationConfidence.t
| `List of
[>
`Structure of
(string
*
[>
`String of
GuardrailAutomatedReasoningStatementLogicContent.t ])
list ]
list
| `String of
GuardrailAutomatedReasoningStatementLogicContent.t ])
list ]
list
| `String of
AutomatedReasoningRuleIdentifier.t ])
list ]
list
| `Structure of
(string
* [> `Double of
GuardrailAutomatedReasoningTranslationConfidence.t
| `Enum of
string
| `List of
[> `Structure of
(string
*
[>
`String of
GuardrailAutomatedReasoningStatementLogicContent.t ])
list ]
list ])
list ])
list ])
list ]
list
| `Long of
GuardrailProcessingLatency.t
| `String of GuardrailId.t
| `Structure of
(string
* [> `Integer of
GuardrailTopicPolicyUnitsProcessed.t
| `Structure of
(string
* [> `Integer of
TextCharactersGuarded.t ])
list ])
list ])
list ])
list ]
list
| `Structure of
(string
* [> `Structure of
(string
* [> `Enum of string
| `List of
[> `Enum of string
| `Structure of
(string
* [> `Boolean of Boolean.t
| `Double of
GuardrailContextualGroundingFilterThresholdDouble.t
| `Enum of string
| `String of String_.t
| `Structure of
(string
* [> `List of
[> `Structure of
(string
* [> `List of
[>
`Structure of
(string
*
[>
`Double of
GuardrailAutomatedReasoningTranslationConfidence.t
| `List of
[>
`Structure of
(string
*
[>
`String of
GuardrailAutomatedReasoningStatementLogicContent.t ])
list ]
list
| `String of
GuardrailAutomatedReasoningStatementLogicContent.t ])
list ]
list
| `String of
AutomatedReasoningRuleIdentifier.t ])
list ]
list
| `Structure of
(string
* [> `Double of
GuardrailAutomatedReasoningTranslationConfidence.t
| `Enum of string
| `List of
[> `Structure of
(string
* [> `String of
GuardrailAutomatedReasoningStatementLogicContent.t ])
list ]
list ])
list ])
list ])
list ]
list
| `Long of GuardrailProcessingLatency.t
| `String of GuardrailId.t
| `Structure of
(string
* [> `Integer of
GuardrailTopicPolicyUnitsProcessed.t
| `Structure of
(string
* [> `Integer of
TextCharactersGuarded.t ])
list ])
list ])
list ])
list ])
list
| `String of String_.t ])
list ])
list ])
list ]