mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
Remove dead methods from ToolRegistry (#91)
* getToolSchemas is deprecated. * listAvailableTools is now getAllTools.
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { ToolListUnion, FunctionDeclaration } from '@google/genai';
|
import { FunctionDeclaration } from '@google/genai';
|
||||||
import { Tool } from './tools.js';
|
import { Tool } from './tools.js';
|
||||||
|
|
||||||
export class ToolRegistry {
|
export class ToolRegistry {
|
||||||
@@ -37,18 +37,6 @@ export class ToolRegistry {
|
|||||||
return declarations;
|
return declarations;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Deprecated/Internal? Retrieves schemas in the ToolListUnion format.
|
|
||||||
* Kept for reference, prefer getFunctionDeclarations.
|
|
||||||
*/
|
|
||||||
getToolSchemas(): ToolListUnion {
|
|
||||||
const declarations = this.getFunctionDeclarations();
|
|
||||||
if (declarations.length === 0) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
return [{ functionDeclarations: declarations }];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array of all registered tool instances.
|
* Returns an array of all registered tool instances.
|
||||||
*/
|
*/
|
||||||
@@ -56,13 +44,6 @@ export class ToolRegistry {
|
|||||||
return Array.from(this.tools.values());
|
return Array.from(this.tools.values());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Optional: Get a list of registered tool names.
|
|
||||||
*/
|
|
||||||
listAvailableTools(): string[] {
|
|
||||||
return Array.from(this.tools.keys());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the definition of a specific tool.
|
* Get the definition of a specific tool.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user