diff options
| author | Anjali Sridhar <[email protected]> | 2025-07-23 06:49:27 -0700 |
|---|---|---|
| committer | Anjali Sridhar <[email protected]> | 2025-07-23 06:49:27 -0700 |
| commit | 1de246236b04f2faf7e0222921568a193a35a275 (patch) | |
| tree | 807c7473b201c461085b261d7ac5e666161bbfb0 | |
| parent | 7c3a84075d03c84687339904c6421728fe520a6c (diff) | |
wip
| -rw-r--r-- | packages/core/src/core/geminiChat.ts | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/packages/core/src/core/geminiChat.ts b/packages/core/src/core/geminiChat.ts index d1a7bdec..5e0a62c0 100644 --- a/packages/core/src/core/geminiChat.ts +++ b/packages/core/src/core/geminiChat.ts @@ -27,10 +27,6 @@ import { logApiError, } from '../telemetry/loggers.js'; import { - getStructuredResponse, - getStructuredResponseFromParts, -} from '../utils/generateContentResponseUtilities.js'; -import { ApiErrorEvent, ApiRequestEvent, ApiResponseEvent, @@ -142,11 +138,7 @@ export class GeminiChat { } private _getRequestTextFromContents(contents: Content[]): string { - return contents - .flatMap((content) => content.parts ?? []) - .map((part) => part.text) - .filter(Boolean) - .join(''); + return JSON.stringify(contents); } private async _logApiRequest( @@ -318,7 +310,7 @@ export class GeminiChat { durationMs, prompt_id, response.usageMetadata, - getStructuredResponse(response), + JSON.stringify(response), ); this.sendPromise = (async () => { @@ -554,12 +546,12 @@ export class GeminiChat { allParts.push(...content.parts); } } - const fullText = getStructuredResponseFromParts(allParts); + await this._logApiResponse( durationMs, prompt_id, this.getFinalUsageMetadata(chunks), - fullText, + JSON.stringify(chunks), ); } this.recordHistory(inputContent, outputContent); |
