mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-19 10:31:16 -07:00
- Addresses a Gemini model bug where it may return an empty content object after a function response. - Previously, the SDK attempted to inject an empty model message, which could disrupt curated history. - This change modifies our custom class to detect this scenario using an utility and avoid pushing an unnecessary empty model message, thus preserving history integrity. Workaround for https://b.corp.google.com/issues/420354090 Part of https://github.com/google-gemini/gemini-cli/issues/551
16 lines
326 B
TypeScript
16 lines
326 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import { Content } from '@google/genai';
|
|
|
|
export function isFunctionResponse(content: Content): boolean {
|
|
return (
|
|
content.role === 'user' &&
|
|
!!content.parts &&
|
|
content.parts.every((part) => !!part.functionResponse)
|
|
);
|
|
}
|