Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

input-modalities.test.ts

18 lines698 Bytes

1import { describe, expect, it } from 'vitest'
2import { createGrokText } from '../src/adapters/text'
3​
4describe('GrokTextAdapter inputModalities', () => {
5 it.each([
6 ['grok-4.7', ['text', 'image', 'document']],
7 ['grok-build-0.1', ['text', 'image']],
8 ] as const)('reads the list of %s from model-meta', (model, expected) => {
9 expect(createGrokText(model, 'test-key').inputModalities).toEqual(expected)
10 })
11​
12 it('is undefined for a model id that model-meta does not list', () => {
13 // @ts-expect-error a JS caller or a cast can pass an id the types reject
14 const adapter = createGrokText('unlisted-model', 'test-key')
15​
16 expect(adapter.inputModalities).toBeUndefined()
17 })
18})