natureco-cli 5.4.20 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -2
- package/src/commands/channel-helper.js +51 -0
- package/src/commands/discord.js +116 -114
- package/src/commands/gateway-server.js +2107 -1977
- package/src/commands/imessage.js +2 -0
- package/src/commands/signal.js +2 -0
- package/src/commands/slack.js +121 -119
- package/src/commands/telegram.js +21 -2
- package/src/commands/whatsapp.js +318 -316
- package/src/utils/api.js +1158 -1054
- package/src/utils/tools.js +27 -8
package/src/utils/tools.js
CHANGED
|
@@ -56,14 +56,33 @@ function loadToolDefinitions() {
|
|
|
56
56
|
* [{ type: "function", function: { name, description, parameters } }]
|
|
57
57
|
*/
|
|
58
58
|
function toOpenAIFormat(toolDefs) {
|
|
59
|
-
return toolDefs.map(t =>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
return toolDefs.map(t => {
|
|
60
|
+
// v5.4.21: Groq uyumluluk - additionalProperties: false kaldirildi
|
|
61
|
+
// ve gereksiz kisitlamalar temizlendi
|
|
62
|
+
const cleanParams = JSON.parse(JSON.stringify(t.parameters || {}));
|
|
63
|
+
if (cleanParams.properties) {
|
|
64
|
+
Object.keys(cleanParams.properties).forEach(key => {
|
|
65
|
+
const prop = cleanParams.properties[key];
|
|
66
|
+
// "type": ["number", "string"] union types Groq'da hata verir
|
|
67
|
+
// Sadece ilk tipi al
|
|
68
|
+
if (Array.isArray(prop.type)) {
|
|
69
|
+
prop.type = prop.type[0];
|
|
70
|
+
}
|
|
71
|
+
// additionalProperties kaldir
|
|
72
|
+
delete prop.additionalProperties;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
// Groq icin required kismi bazen sorun cikarir - olduugu gibi birak
|
|
76
|
+
// ama type validation'u gevset
|
|
77
|
+
return {
|
|
78
|
+
type: 'function',
|
|
79
|
+
function: {
|
|
80
|
+
name: t.name,
|
|
81
|
+
description: t.description,
|
|
82
|
+
parameters: cleanParams,
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
});
|
|
67
86
|
}
|
|
68
87
|
|
|
69
88
|
/**
|