diff options
| author | uttamkanodia14 <[email protected]> | 2025-07-10 00:19:30 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-09 18:49:30 +0000 |
| commit | 063481faa4b1c86868689580ff0fbd8cb04141e3 (patch) | |
| tree | f7b38f46a95cd22bbf15a7454963ba834e15d134 /packages/cli/src/nonInteractiveCli.ts | |
| parent | 6c12f9e0d902c60fa5e01422018ce773c405da8d (diff) | |
Adding TurnId to Tool call and API responses and error logs. (#3039)
Co-authored-by: Scott Densmore <[email protected]>
Diffstat (limited to 'packages/cli/src/nonInteractiveCli.ts')
| -rw-r--r-- | packages/cli/src/nonInteractiveCli.ts | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/packages/cli/src/nonInteractiveCli.ts b/packages/cli/src/nonInteractiveCli.ts index 92fce058..b8b8ac3f 100644 --- a/packages/cli/src/nonInteractiveCli.ts +++ b/packages/cli/src/nonInteractiveCli.ts @@ -46,6 +46,7 @@ function getResponseText(response: GenerateContentResponse): string | null { export async function runNonInteractive( config: Config, input: string, + prompt_id: string, ): Promise<void> { await config.initialize(); // Handle EPIPE errors when the output is piped to a command that closes early. @@ -67,15 +68,18 @@ export async function runNonInteractive( while (true) { const functionCalls: FunctionCall[] = []; - const responseStream = await chat.sendMessageStream({ - message: currentMessages[0]?.parts || [], // Ensure parts are always provided - config: { - abortSignal: abortController.signal, - tools: [ - { functionDeclarations: toolRegistry.getFunctionDeclarations() }, - ], + const responseStream = await chat.sendMessageStream( + { + message: currentMessages[0]?.parts || [], // Ensure parts are always provided + config: { + abortSignal: abortController.signal, + tools: [ + { functionDeclarations: toolRegistry.getFunctionDeclarations() }, + ], + }, }, - }); + prompt_id, + ); for await (const resp of responseStream) { if (abortController.signal.aborted) { @@ -101,6 +105,7 @@ export async function runNonInteractive( name: fc.name as string, args: (fc.args ?? {}) as Record<string, unknown>, isClientInitiated: false, + prompt_id, }; const toolResponse = await executeToolCall( |
