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

input-modalities.test.ts

18 lines719 Bytes

1import { describe, expect, it } from 'vitest'
2import { createGroqText } from '../src/adapters/text'
3​
4describe('GroqTextAdapter inputModalities', () => {
5 it.each([
6 ['meta-llama/llama-4-scout-17b-16e-instruct', ['text', 'image']],
7 ['llama-3.3-70b-versatile', ['text']],
8 ] as const)('reads the list of %s from model-meta', (model, expected) => {
9 expect(createGroqText(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 = createGroqText('unlisted-model', 'test-key')
15​
16 expect(adapter.inputModalities).toBeUndefined()
17 })
18})