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.
@@ -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
- type: 'function',
61
- function: {
62
- name: t.name,
63
- description: t.description,
64
- parameters: t.parameters,
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
  /**