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

input-modalities.test.ts

24 lines960 Bytes

1import { describe, expect, it } from 'vitest'
2import { GeminiTextAdapter } from '../src/adapters/text'
3​
4// Constructing the SDK client makes no network call.
5const config = { apiKey: 'test-key' }
6​
7describe('Gemini text adapter inputModalities', () => {
8 it('gives the input list of each known model', () => {
9 expect(
10 new GeminiTextAdapter(config, 'gemini-3.1-pro-preview').inputModalities,
11 ).toEqual(['text', 'image', 'audio', 'video', 'document'])
12 expect(
13 new GeminiTextAdapter(config, 'gemini-2.5-flash').inputModalities,
14 ).toEqual(['text', 'image', 'audio', 'video'])
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 - 'gemini-unknown-9000' is not a declared model
20 const adapter = new GeminiTextAdapter(config, 'gemini-unknown-9000')
21​
22 expect(adapter.inputModalities).toBeUndefined()
23 })
24})