mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-28 05:55:17 -07:00
refactor: integrate resolver into read_file and shell tools
This commit is contained in:
@@ -24,6 +24,7 @@ import { FileOperationEvent } from '../telemetry/types.js';
|
||||
import { READ_FILE_TOOL_NAME } from './tool-names.js';
|
||||
import { FileDiscoveryService } from '../services/fileDiscoveryService.js';
|
||||
import { READ_FILE_DEFINITION } from './definitions/coreTools.js';
|
||||
import { resolveToolDeclaration } from './definitions/resolver.js';
|
||||
|
||||
/**
|
||||
* Parameters for the ReadFile tool
|
||||
@@ -235,9 +236,10 @@ export class ReadFileTool extends BaseDeclarativeTool<
|
||||
);
|
||||
}
|
||||
|
||||
override getSchema(_modelId?: string) {
|
||||
// Pure refactor: maintain existing behavior.
|
||||
// getSchema(modelId) is now available for future model-specific overrides.
|
||||
return super.getSchema();
|
||||
override getSchema(modelId?: string) {
|
||||
if (!modelId) {
|
||||
return super.getSchema();
|
||||
}
|
||||
return resolveToolDeclaration(READ_FILE_DEFINITION, modelId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user