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

gemini-server-tools-wire.spec.ts

28 lines909 Bytes

1import { test, expect } from './fixtures'
2​
3/**
4 * Google Search beside a function tool on Gemini 3. The
5 * `/gemini-server-tools` mount fails like the Gemini API when the request has
6 * no `includeServerSideToolInvocations`, or when the next step does not send
7 * the signed `toolCall` / `toolResponse` parts back around the function call.
8 */
9test('gemini runs Google Search and a function tool in one agent loop', async ({
10 request,
11}) => {
12 const res = await request.post('/api/gemini-server-tools-wire')
13 expect(res.ok()).toBe(true)
14 const result = (await res.json()) as {
15 ok: boolean
16 error?: string
17 text: string
18 tools: Array<string>
19 }
20 expect(result.error).toBeUndefined()
21 expect(result).toMatchObject({
22 ok: true,
23 text: 'Caucus night is Tuesday at the library.',
24 })
25 expect(result.tools).toEqual(
26 expect.arrayContaining(['lookup_caucus', 'google_search']),
27 )
28})