Stream HelpersAWSBedrockStream

AWSBedrockStream

The AWS Bedrock stream functions are utilties that transform the outputs from the AWS Bedrock API into a ReadableStream. It uses AIStream under the hood and handle parsing Bedrock's response.

Import

React

import { AWSBedrockStream } from "ai"

Parameters

response:

Response
The response object returned by a call made by the Provider SDK.

callback?:

AIStreamCallbacks
An object containing callback functions to handle the start, each token, and completion of the AI response. In the absence of this parameter, default behavior is implemented.

Returns

A ReadableStream.