Files
gemini-cli/packages/server/src/utils/generateContentResponseUtilities.ts
Taylor Mullen aa65a4a1fc Prevent console.warn's for tool calls.
- Added helper for extracting text content from responses without warning.

See fixed issue for more detail: https://b.corp.google.com/issues/414005146
2025-04-26 15:50:44 -07:00

18 lines
366 B
TypeScript

/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { GenerateContentResponse } from '@google/genai';
export function getResponseText(
response: GenerateContentResponse,
): string | undefined {
return (
response.candidates?.[0]?.content?.parts
?.map((part) => part.text)
.join('') || undefined
);
}