mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-08-09 08:27:00 -07:00
f47d6c6f7a
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
25 lines
551 B
TypeScript
25 lines
551 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import type { Content } from '@google/genai';
|
|
|
|
export function isFunctionResponse(content: Content): boolean {
|
|
return (
|
|
content.role === 'user' &&
|
|
!!content.parts &&
|
|
content.parts.some((part) => !!part.functionResponse)
|
|
);
|
|
}
|
|
|
|
export function isFunctionCall(content: Content): boolean {
|
|
return (
|
|
content.role === 'model' &&
|
|
!!content.parts &&
|
|
content.parts.length > 0 &&
|
|
content.parts.every((part) => !!part.functionCall)
|
|
);
|
|
}
|