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

gemini-native-image-wire.spec.ts

38 lines1.3 KB

1import { test, expect } from './fixtures'
2​
3/**
4 * Wire-format verification for Gemini-native image modelOptions on the
5 * Interactions API.
6 *
7 * `/api/gemini-native-image-wire` generates with `safetySettings` and
8 * `thinkingConfig.thinkingLevel`, then edits with `previous_interaction_id`.
9 * `geminiNativeImageMount` 400s unless the first body has snake_case
10 * `safety_settings` and `generation_config.thinking_level: "low"`, and the
11 * second body chains without an image block. The two ids are the server
12 * interaction ids.
13 */
14test.describe('gemini native image — modelOptions reach the Interactions wire', () => {
15 test('safety settings, thinking level, and a chained edit survive', async ({
16 request,
17 }) => {
18 const res = await request.post('/api/gemini-native-image-wire')
19 expect(res.ok()).toBe(true)
20​
21 const { ok, images, editImages, firstId, editId, error } =
22 (await res.json()) as {
23 ok: boolean
24 images?: number
25 editImages?: number
26 firstId?: string
27 editId?: string
28 error?: string
29 }
30​
31 expect(error ?? null).toBeNull()
32 expect(ok).toBe(true)
33 expect(images).toBe(1)
34 expect(editImages).toBe(1)
35 expect(firstId).toBe('int_e2e_create')
36 expect(editId).toBe('int_e2e_edit')
37 })
38})