mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 04:30:48 +00:00
Add /tools slash command to view available tools (#752)
This commit is contained in:
parent
fdc8bd8ed9
commit
d99d132cdf
2 changed files with 120 additions and 1 deletions
|
|
@ -161,7 +161,28 @@ export const useSlashCommandProcessor = (
|
|||
}
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: 'tools',
|
||||
description: 'list available tools',
|
||||
action: async (_mainCommand, _subCommand, _args) => {
|
||||
const toolRegistry = await config?.getToolRegistry();
|
||||
const tools = toolRegistry?.getAllTools();
|
||||
if (!tools) {
|
||||
addMessage({
|
||||
type: MessageType.ERROR,
|
||||
content: 'Could not retrieve tools.',
|
||||
timestamp: new Date(),
|
||||
});
|
||||
return;
|
||||
}
|
||||
const toolList = tools.map((tool) => tool.name);
|
||||
addMessage({
|
||||
type: MessageType.INFO,
|
||||
content: `Available tools:\n\n${toolList.join('\n')}`,
|
||||
timestamp: new Date(),
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'corgi',
|
||||
action: (_mainCommand, _subCommand, _args) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue