AWSBedrockCohereStream

AWSBedrockCohereStream has been removed in AI SDK 4.0.

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

Import

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 handles parsing Bedrock's response.

React

import { AWSBedrockCohereStream } 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.