(toolset: SimpleToolset, provider: ChatProvider)
| 58 | } |
| 59 | |
| 60 | async function runTwoStepLoop(toolset: SimpleToolset, provider: ChatProvider) { |
| 61 | const history: Message[] = [ |
| 62 | { role: 'user', content: [{ type: 'text', text: 'run the tool chain' }], toolCalls: [] }, |
| 63 | ]; |
| 64 | |
| 65 | const first = await step(provider, '', toolset, history); |
| 66 | history.push(first.message); |
| 67 | |
| 68 | const toolResults = await first.toolResults(); |
| 69 | for (const toolResult of toolResults) { |
| 70 | history.push(createToolMessage(toolResult.toolCallId, toolResult.returnValue.output)); |
| 71 | } |
| 72 | |
| 73 | const second = await step(provider, '', toolset, history); |
| 74 | history.push(second.message); |
| 75 | |
| 76 | return { first, second, toolResults, history }; |
| 77 | } |
| 78 | |
| 79 | describe('e2e: kosong toolchain bridges', () => { |
| 80 | it('typed-tool -> SimpleToolset -> step dispatches nested Zod args and completes the loop', async () => { |
no test coverage detected