AWSBedrockLlama2Stream

AWSBedrockLlama2Stream has been removed in AI SDK 4.0.

AWSBedrockLlama2Stream is part of the legacy AWS Bedrock integration. It is not compatible with the AI SDK 3.1 functions.

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 { AWSBedrockLlama2Stream } from "ai"

API Signature

Parameters

response:

AWSBedrockResponse
AWSBedrockResponse

body?:

AsyncIterable<{ chunk?: { bytes?: Uint8Array } }>

callbacks?:

AIStreamCallbacksAndOptions
AIStreamCallbacksAndOptions

onStart:

() => Promise<void>

onCompletion:

(completion: string) => Promise<void>

onFinal:

(completion: string) => Promise<void>

onToken:

(token: string) => Promise<void>

Returns

A ReadableStream.