mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
Add and improve JSDoc comments for core tool methods (#3128)
This commit is contained in:
@@ -81,7 +81,12 @@ export class WebSearchTool extends BaseTool<
|
||||
);
|
||||
}
|
||||
|
||||
validateParams(params: WebSearchToolParams): string | null {
|
||||
/**
|
||||
* Validates the parameters for the WebSearchTool.
|
||||
* @param params The parameters to validate
|
||||
* @returns An error message string if validation fails, null if valid
|
||||
*/
|
||||
validateToolParams(params: WebSearchToolParams): string | null {
|
||||
if (
|
||||
this.schema.parameters &&
|
||||
!SchemaValidator.validate(
|
||||
@@ -105,7 +110,7 @@ export class WebSearchTool extends BaseTool<
|
||||
params: WebSearchToolParams,
|
||||
signal: AbortSignal,
|
||||
): Promise<WebSearchToolResult> {
|
||||
const validationError = this.validateParams(params);
|
||||
const validationError = this.validateToolParams(params);
|
||||
if (validationError) {
|
||||
return {
|
||||
llmContent: `Error: Invalid parameters provided. Reason: ${validationError}`,
|
||||
|
||||
Reference in New Issue
Block a user