MistralStream

MistralStream has been removed in AI SDK 4.0.

MistralStream is part of the legacy Mistral integration. It is not compatible with the AI SDK 3.1 functions. It is recommended to use the AI SDK Mistral Provider instead.

Transforms the output from Mistral's language models into a ReadableStream.

This works with the official Mistral API, and it's supported in both Node.js, the Edge Runtime, and browser environments.

Import

React

import { MistralStream } from "ai"

API Signature

Parameters

response:

Response

callbacks?:

AIStreamCallbacksAndOptions
AIStreamCallbacksAndOptions

onStart:

() => Promise<void>

onCompletion:

(completion: string) => Promise<void>

onFinal:

(completion: string) => Promise<void>

onToken:

(token: string) => Promise<void>

Returns

A ReadableStream.