mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 04:00:36 +00:00
Add concatenation tool (#130)
* Adding a tool inspired by files-to-prompt that will recursivly read through all the files in a directory (guarded by targetDir) and concatenate those files for the model. Ignores common build artifacts and non-text files. * Migraded glob logic to fast-glob. Buffed the tool description to give more guidance to the model. Incorporated reveiw feedback. * lint and error checking.
This commit is contained in:
parent
d771dcbdb9
commit
cf92ffab34
2 changed files with 388 additions and 0 deletions
|
|
@ -17,6 +17,7 @@ import { EditTool } from '../tools/edit.js';
|
|||
import { TerminalTool } from '../tools/terminal.js';
|
||||
import { WriteFileTool } from '../tools/write-file.js';
|
||||
import { WebFetchTool } from '../tools/web-fetch.js';
|
||||
import { ReadManyFilesTool } from '../tools/read-many-files.js';
|
||||
|
||||
const DEFAULT_PASSTHROUGH_COMMANDS = ['ls', 'git', 'npm'];
|
||||
|
||||
|
|
@ -130,6 +131,7 @@ function createToolRegistry(config: Config): ToolRegistry {
|
|||
new TerminalTool(targetDir, config),
|
||||
new WriteFileTool(targetDir),
|
||||
new WebFetchTool(), // Note: WebFetchTool takes no arguments
|
||||
new ReadManyFilesTool(targetDir),
|
||||
];
|
||||
for (const tool of tools) {
|
||||
registry.registerTool(tool);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue