Module Values.InvokeModelWithResponseStreamResponseSource

Invoke the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. The response is returned in a stream. To see if a model supports streaming, call GetFoundationModel and check the responseStreamingSupported field in the response. The CLI doesn't support streaming operations in Amazon Bedrock, including InvokeModelWithResponseStream. For example code, see Invoke model with streaming code example in the Amazon Bedrock User Guide. This operation requires permissions to perform the bedrock:InvokeModelWithResponseStream 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 Converse API actions (Converse and ConverseStream). For more information see Deny access for inference on specific models. For troubleshooting some of the common errors you might encounter when using the InvokeModelWithResponseStream API, see Troubleshooting Amazon Bedrock API Error Codes in the Amazon Bedrock User Guide

Sourcetype nonrec t = {
  1. body : ResponseStream.t option;
    (*

    Inference response from the model in the format specified by the contentType header. To see the format and content of this field for different models, refer to Inference parameters.

    *)
  2. contentType : MimeType.t option;
    (*

    The MIME type of the inference result.

    *)
  3. performanceConfigLatency : PerformanceConfigLatency.t option;
    (*

    Model performance settings for the request.

    *)
  4. serviceTier : ServiceTierType.t option;
    (*

    Specifies the processing tier type used for serving the request.

    *)
}
Sourcetype nonrec error = [
  1. | `AccessDeniedException of AccessDeniedException.t
  2. | `InternalServerException of InternalServerException.t
  3. | `ModelErrorException of ModelErrorException.t
  4. | `ModelNotReadyException of ModelNotReadyException.t
  5. | `ModelStreamErrorException of ModelStreamErrorException.t
  6. | `ModelTimeoutException of ModelTimeoutException.t
  7. | `ResourceNotFoundException of ResourceNotFoundException.t
  8. | `ServiceQuotaExceededException of ServiceQuotaExceededException.t
  9. | `ServiceUnavailableException of ServiceUnavailableException.t
  10. | `ThrottlingException of ThrottlingException.t
  11. | `ValidationException of ValidationException.t
  12. | `Unknown_operation_error of string * string option
]
Sourceval make : ?body:??? -> ?contentType:??? -> ?performanceConfigLatency:??? -> ?serviceTier:??? -> unit -> t
Sourceval error_of_json : string -> Yojson.Safe.t -> [> `AccessDeniedException of AccessDeniedException.t | `InternalServerException of InternalServerException.t | `ModelErrorException of ModelErrorException.t | `ModelNotReadyException of ModelNotReadyException.t | `ModelStreamErrorException of ModelStreamErrorException.t | `ModelTimeoutException of ModelTimeoutException.t | `ResourceNotFoundException of ResourceNotFoundException.t | `ServiceQuotaExceededException of ServiceQuotaExceededException.t | `ServiceUnavailableException of ServiceUnavailableException.t | `ThrottlingException of ThrottlingException.t | `Unknown_operation_error of string * string option | `ValidationException of ValidationException.t ]
Sourceval error_of_xml : string -> Awso.Xml.t -> [> `AccessDeniedException of AccessDeniedException.t | `InternalServerException of InternalServerException.t | `ModelErrorException of ModelErrorException.t | `ModelNotReadyException of ModelNotReadyException.t | `ModelStreamErrorException of ModelStreamErrorException.t | `ModelTimeoutException of ModelTimeoutException.t | `ResourceNotFoundException of ResourceNotFoundException.t | `ServiceQuotaExceededException of ServiceQuotaExceededException.t | `ServiceUnavailableException of ServiceUnavailableException.t | `ThrottlingException of ThrottlingException.t | `Unknown_operation_error of string * string option | `ValidationException of ValidationException.t ]
Sourceval error_to_json : error -> Yojson.Safe.t
Sourceval of_header_and_body : ((string, MimeType.t) Awso.Import.List.Assoc.t * ResponseStream.t) -> t
Sourceval to_value : t -> [> `Structure of (string * [> `Enum of string | `String of MimeType.t | `Structure of (string * [> `Structure of (string * [> `Blob of PartBody.t | `Integer of StatusCode.t | `String of NonBlankString.t ]) list ]) list ]) list ]
Sourceval to_query : t -> Awso.Client.Query.t
Sourceval of_xml : Awso.Xml.t -> t
Sourceval of_string : string -> t
Sourceval of_json : Yojson.Safe.t -> t
Sourceval to_json : t -> Yojson.Safe.t