mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
Improve Function Call argument validation and typing (#2881)
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
This commit is contained in:
committed by
GitHub
parent
137ffec3f6
commit
4dab31f1c8
@@ -80,8 +80,8 @@ describe('GrepTool', () => {
|
||||
|
||||
it('should return error if pattern is missing', () => {
|
||||
const params = { path: '.' } as unknown as GrepToolParams;
|
||||
expect(grepTool.validateToolParams(params)).toContain(
|
||||
'Parameters failed schema validation',
|
||||
expect(grepTool.validateToolParams(params)).toBe(
|
||||
`params must have required property 'pattern'`,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -204,11 +204,11 @@ describe('GrepTool', () => {
|
||||
it('should return an error if params are invalid', async () => {
|
||||
const params = { path: '.' } as unknown as GrepToolParams; // Invalid: pattern missing
|
||||
const result = await grepTool.execute(params, abortSignal);
|
||||
expect(result.llmContent).toContain(
|
||||
'Error: Invalid parameters provided. Reason: Parameters failed schema validation',
|
||||
expect(result.llmContent).toBe(
|
||||
"Error: Invalid parameters provided. Reason: params must have required property 'pattern'",
|
||||
);
|
||||
expect(result.returnDisplay).toContain(
|
||||
'Model provided invalid parameters. Error: Parameters failed schema validation',
|
||||
expect(result.returnDisplay).toBe(
|
||||
"Model provided invalid parameters. Error: params must have required property 'pattern'",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user