refactor: remove unnecessary assertion (#2579)

This commit is contained in:
Noritaka Kobayashi 2025-06-30 04:06:03 +09:00 committed by GitHub
parent 65a58c3b03
commit 9ae2595bfd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 9 additions and 31 deletions

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: Apache-2.0
*/
import { GroundingMetadata } from '@google/genai';
import { SchemaValidator } from '../utils/schemaValidator.js';
import {
BaseTool,
@ -255,9 +254,7 @@ ${textContent}
let responseText = getResponseText(response) || '';
const urlContextMeta = response.candidates?.[0]?.urlContextMetadata;
const groundingMetadata = response.candidates?.[0]?.groundingMetadata as
| GroundingMetadata
| undefined;
const groundingMetadata = response.candidates?.[0]?.groundingMetadata;
const sources = groundingMetadata?.groundingChunks as
| GroundingChunkItem[]
| undefined;