Stream HelpersMistralStream

MistralStream

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"

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.