ai-functions 0.2.14 → 0.2.15
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/dist/cjs/utils/schema.js +2 -2
- package/dist/mjs/utils/schema.js +2 -2
- package/package.json +1 -1
- package/utils/schema.ts +2 -2
package/dist/cjs/utils/schema.js
CHANGED
|
@@ -61,11 +61,11 @@ const generateSchema = (propDescriptions) => {
|
|
|
61
61
|
const itemType = typeof itemValue;
|
|
62
62
|
if (itemType == 'string') {
|
|
63
63
|
// If the item is a string, then it is an array of strings
|
|
64
|
-
|
|
64
|
+
properties[key] = { type: 'array', description: itemValue, items: { type: 'string' } };
|
|
65
65
|
}
|
|
66
66
|
else if (itemType == 'object') {
|
|
67
67
|
// If the item is an object, then it is an array of objects, and get the schema for the object
|
|
68
|
-
|
|
68
|
+
properties[key] = { type: 'array', items: (0, exports.generateSchema)(itemValue) };
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
else {
|
package/dist/mjs/utils/schema.js
CHANGED
|
@@ -57,11 +57,11 @@ export const generateSchema = (propDescriptions) => {
|
|
|
57
57
|
const itemType = typeof itemValue;
|
|
58
58
|
if (itemType == 'string') {
|
|
59
59
|
// If the item is a string, then it is an array of strings
|
|
60
|
-
|
|
60
|
+
properties[key] = { type: 'array', description: itemValue, items: { type: 'string' } };
|
|
61
61
|
}
|
|
62
62
|
else if (itemType == 'object') {
|
|
63
63
|
// If the item is an object, then it is an array of objects, and get the schema for the object
|
|
64
|
-
|
|
64
|
+
properties[key] = { type: 'array', items: generateSchema(itemValue) };
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
else {
|
package/package.json
CHANGED
package/utils/schema.ts
CHANGED
|
@@ -60,10 +60,10 @@ export const generateSchema = (propDescriptions: Record<string, string | Record<
|
|
|
60
60
|
const itemType = typeof itemValue
|
|
61
61
|
if (itemType == 'string') {
|
|
62
62
|
// If the item is a string, then it is an array of strings
|
|
63
|
-
|
|
63
|
+
properties[key] = { type: 'array', description: itemValue, items: { type: 'string' }}
|
|
64
64
|
} else if (itemType == 'object') {
|
|
65
65
|
// If the item is an object, then it is an array of objects, and get the schema for the object
|
|
66
|
-
|
|
66
|
+
properties[key] = { type: 'array', items: generateSchema(itemValue)}
|
|
67
67
|
}
|
|
68
68
|
} else {
|
|
69
69
|
throw new Error(`Invalid description for key "${key}".`)
|