feat: useToolScheduler hook to manage parallel tool calls (#448)

This commit is contained in:
Brandon Keiji
2025-05-22 05:57:53 +00:00
committed by GitHub
parent efee7c6cce
commit 02eec5c8ca
6 changed files with 109 additions and 369 deletions

View File

@@ -155,10 +155,9 @@ export class GeminiClient {
signal?: AbortSignal,
): AsyncGenerator<ServerGeminiStreamEvent> {
let turns = 0;
const availableTools = this.config.getToolRegistry().getAllTools();
while (turns < this.MAX_TURNS) {
turns++;
const turn = new Turn(chat, availableTools);
const turn = new Turn(chat);
const resultStream = turn.run(request, signal);
let seenError = false;
for await (const event of resultStream) {