mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-28 05:55:17 -07:00
feat: implement model-dependent tool definitions architecture and refactor read_file and shell tools
This commit is contained in:
@@ -23,6 +23,8 @@ import { logFileOperation } from '../telemetry/loggers.js';
|
||||
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
|
||||
@@ -252,4 +254,11 @@ export class ReadFileTool extends BaseDeclarativeTool<
|
||||
_toolDisplayName,
|
||||
);
|
||||
}
|
||||
|
||||
override getSchema(modelId?: string) {
|
||||
if (!modelId) {
|
||||
return super.getSchema();
|
||||
}
|
||||
return resolveToolDeclaration(READ_FILE_DEFINITION, modelId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user