Repository navigation
Expand file tree
/
Copy pathadmin-tool.js
More file actions
52 lines (46 loc) · 1.45 KB
/
Copy pathadmin-tool.js
File metadata and controls
52 lines (46 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// admin-tool.js
const { actionsConfig } = require('./actions-config');
const { memoryToolDeclarations } = require('./core/memory-tools');
// Generate tool declarations from central config (exclude execute function)
const adminFunctionDeclarations = Object.entries(actionsConfig).map(([name, config]) => ({
name,
description: config.description,
parameters: config.parameters,
}));
// Extract permissions for permission gating
const functionPermissions = {};
Object.entries(actionsConfig).forEach(([name, config]) => {
if (config.permission) {
functionPermissions[name] = config.permission;
}
});
const searchTool = [
{
functionDeclarations: [
{
name: 'web_search',
description: 'Search the internet for current, real-time information. Use this for: current prices, news, weather, sports scores, recent events, trending topics, or any information that changes over time. Returns the latest data from the web.',
parameters: {
type: 'object',
properties: {
query: { type: 'string', description: 'Search query for current information' }
},
required: ['query']
}
}
]
}
];
const adminTools = [
{ functionDeclarations: adminFunctionDeclarations },
];
// Memory tools for on-demand context retrieval
const memoryTools = [
{ functionDeclarations: memoryToolDeclarations },
];
module.exports = {
searchTool,
adminTools,
memoryTools,
functionPermissions,
};