Open History to see the last commit
1import { describe, expect, it } from 'vitest'
2import { MistralTextAdapter } from './adapters/text'
3
4// Constructing the SDK client makes no network call.
5const config = { apiKey: 'test-key' }
6
7describe('Mistral text adapter inputModalities', () => {
8 it('gives the input list of each known model', () => {
9 expect(
10 new MistralTextAdapter(config, 'mistral-large-latest').inputModalities,
11 ).toEqual(['text'])
12 expect(
13 new MistralTextAdapter(config, 'pixtral-large-latest').inputModalities,
14 ).toEqual(['text', 'image', 'document'])
15 })
16
17 it('is undefined for a model the metadata does not list', () => {
18 // A JS caller, or a model id newer than this package, reaches the adapter.
19 // @ts-expect-error - 'mistral-unknown-9000' is not a declared model
20 const adapter = new MistralTextAdapter(config, 'mistral-unknown-9000')
21
22 expect(adapter.inputModalities).toBeUndefined()
23 })
24})