mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
Fix for validating getDescription in read_file tool call (#660)
This commit is contained in:
@@ -93,6 +93,13 @@ export class ReadFileTool extends BaseTool<ReadFileToolParams, ToolResult> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getDescription(params: ReadFileToolParams): string {
|
getDescription(params: ReadFileToolParams): string {
|
||||||
|
if (
|
||||||
|
!params ||
|
||||||
|
typeof params.path !== 'string' ||
|
||||||
|
params.path.trim() === ''
|
||||||
|
) {
|
||||||
|
return `Path unavailable`;
|
||||||
|
}
|
||||||
const relativePath = makeRelative(params.path, this.rootDirectory);
|
const relativePath = makeRelative(params.path, this.rootDirectory);
|
||||||
return shortenPath(relativePath);
|
return shortenPath(relativePath);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user