mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 09:17:53 +00:00
24 lines
520 B
TypeScript
24 lines
520 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.every((part) => !!part.functionResponse)
|
|
);
|
|
}
|
|
|
|
export function isFunctionCall(content: Content): boolean {
|
|
return (
|
|
content.role === 'model' &&
|
|
!!content.parts &&
|
|
content.parts.every((part) => !!part.functionCall)
|
|
);
|
|
}
|