UNPKG

@ai-sdk/mistral

Version:

The **[Mistral provider](https://ai-sdk.dev/providers/ai-sdk-providers/mistral)** for the [AI SDK](https://ai-sdk.dev/docs) contains language model, embedding model, and speech model support for Mistral APIs.

18 lines (16 loc) 419 B
import type { LanguageModelV4FinishReason } from '@ai-sdk/provider'; export function mapMistralFinishReason( finishReason: string | null | undefined, ): LanguageModelV4FinishReason['unified'] { switch (finishReason) { case 'stop': return 'stop'; case 'length': case 'model_length': return 'length'; case 'tool_calls': return 'tool-calls'; default: return 'other'; } }