Optional
auth?: MistralAuthConfigAuthentication configuration for Mistral. If not supplied, it will be loaded from the environment.
Optional
client?: HttpClient<THttpClientOptions>HTTP client to use for requests. If not supplied, the built-in fetch-based implementation will be used.
The model ID as defined by Mistral.
The Mistral Model Provider with the MistralAiApi
If no auth is passed and MISTRAL_API_KEY is not found in process.env
import { createMistralModelProvider } from "generative-ts";
const mistralLarge = createMistralModelProvider({
modelId: "mistral-large-latest", // Mistral defined model ID
// you can explicitly pass auth here, otherwise by default it is read from process.env
});
const response = await mistralLarge.sendRequest({
$prompt: "Brief History of NY Mets:"
// all other Mistral ChatCompletion API options available here
});
console.log(response.choices[0]?.message.content);
Creates a Mistral ModelProvider with the MistralAiApi
Provider Setup and Notes
Create an API account at Mistral
Obtain a Mistral API key and either pass them explicitly in
auth
or set them in the environment asMISTRAL_API_KEY
Model Parameters
Model IDs