summaryrefslogtreecommitdiff
path: root/packages/server/src/core/turn.ts
diff options
context:
space:
mode:
authorBrandon Keiji <[email protected]>2025-05-22 09:51:07 +0000
committerGitHub <[email protected]>2025-05-22 02:51:07 -0700
commita8bfdf2d5603e9e2fb01e12d6c5499662dccaa85 (patch)
tree5c191574d4d1ae3d2ebc7a75139ca47e7f96b915 /packages/server/src/core/turn.ts
parent174fdce7d8230a12f879874cf7121698d91e678c (diff)
fix: synchronization between executed tools and turn loops (#488)
Diffstat (limited to 'packages/server/src/core/turn.ts')
-rw-r--r--packages/server/src/core/turn.ts14
1 files changed, 1 insertions, 13 deletions
diff --git a/packages/server/src/core/turn.ts b/packages/server/src/core/turn.ts
index 7b2a96f9..38932041 100644
--- a/packages/server/src/core/turn.ts
+++ b/packages/server/src/core/turn.ts
@@ -106,19 +106,15 @@ export type ServerGeminiStreamEvent =
// A turn manages the agentic loop turn within the server context.
export class Turn {
- private pendingToolCalls: Array<{
+ readonly pendingToolCalls: Array<{
callId: string;
name: string;
args: Record<string, unknown>;
}>;
- private fnResponses: Part[];
- private confirmationDetails: ToolCallConfirmationDetails[];
private debugResponses: GenerateContentResponse[];
constructor(private readonly chat: Chat) {
this.pendingToolCalls = [];
- this.fnResponses = [];
- this.confirmationDetails = [];
this.debugResponses = [];
}
// The run method yields simpler events suitable for server logic
@@ -182,14 +178,6 @@ export class Turn {
return { type: GeminiEventType.ToolCallRequest, value };
}
- getConfirmationDetails(): ToolCallConfirmationDetails[] {
- return this.confirmationDetails;
- }
-
- getFunctionResponses(): Part[] {
- return this.fnResponses;
- }
-
getDebugResponses(): GenerateContentResponse[] {
return this.debugResponses;
}