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

parallel-tool-calls.spec.ts

37 lines1011 Bytes

1import { test, expect } from './fixtures'
2import {
3 sendMessage,
4 waitForResponse,
5 getToolCalls,
6 waitForAssistantText,
7 featureUrl,
8} from './helpers'
9import { providersFor } from './test-matrix'
10​
11for (const provider of providersFor('parallel-tool-calls')) {
12 test.describe(`${provider} — parallel-tool-calls`, () => {
13 test('calls multiple tools in parallel', async ({
14 page,
15 testId,
16 aimockPort,
17 }) => {
18 await page.goto(
19 featureUrl(provider, 'parallel-tool-calls', testId, aimockPort),
20 )
21​
22 await sendMessage(
23 page,
24 '[parallel] compare the stratocaster and les paul',
25 )
26 await waitForResponse(page)
27​
28 const toolCalls = await getToolCalls(page)
29 const toolNames = toolCalls.map((t) => t.name)
30 expect(toolNames).toContain('getGuitars')
31 expect(toolNames).toContain('compareGuitars')
32​
33 // Wait for text response after tool execution
34 await waitForAssistantText(page, 'Stratocaster')
35 })
36 })