Spaces:
Sleeping
Sleeping
Delete translator.js
Browse files- translator.js +0 -45
translator.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
| 1 |
-
// Transforms the internal DB schema to target SDK formats
|
| 2 |
-
function formatResponse(tool, targetFormat) {
|
| 3 |
-
|
| 4 |
-
// Safety check
|
| 5 |
-
if (!tool) return null;
|
| 6 |
-
|
| 7 |
-
switch (targetFormat) {
|
| 8 |
-
case 'gemini':
|
| 9 |
-
// Gemini: Function Declarations
|
| 10 |
-
return {
|
| 11 |
-
name: tool.name.replace(/[^a-zA-Z0-9]/g, '_'), // Gemini strict naming
|
| 12 |
-
description: tool.description,
|
| 13 |
-
// In a real scenario, we would parse the README or code to get parameters.
|
| 14 |
-
// For now, we return a generic schema so the Agent knows it exists.
|
| 15 |
-
parameters: { type: "OBJECT", properties: {} }
|
| 16 |
-
};
|
| 17 |
-
|
| 18 |
-
case 'openai':
|
| 19 |
-
// OpenAI: Tools Array
|
| 20 |
-
return {
|
| 21 |
-
type: "function",
|
| 22 |
-
function: {
|
| 23 |
-
name: tool.name,
|
| 24 |
-
description: tool.description,
|
| 25 |
-
parameters: { type: "object", properties: {} }
|
| 26 |
-
}
|
| 27 |
-
};
|
| 28 |
-
|
| 29 |
-
case 'vscode':
|
| 30 |
-
case 'claude':
|
| 31 |
-
// Config for claude_desktop_config.json
|
| 32 |
-
return {
|
| 33 |
-
[tool.name]: {
|
| 34 |
-
command: "npx",
|
| 35 |
-
args: ["-y", tool.name]
|
| 36 |
-
}
|
| 37 |
-
};
|
| 38 |
-
|
| 39 |
-
default:
|
| 40 |
-
// Default: Return the AgentQ Enhanced Schema
|
| 41 |
-
return tool;
|
| 42 |
-
}
|
| 43 |
-
}
|
| 44 |
-
|
| 45 |
-
module.exports = { formatResponse };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|