Skip to content

Commit 21d3523

Browse files
committed
fix: add isProperties parameter to _convertSchemaToGemini for handling property definitions
1 parent 5ded9d7 commit 21d3523

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/core/FormatConverter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ class FormatConverter {
184184
*
185185
* @param {Object} obj - The schema object to convert
186186
* @param {boolean} [isResponseSchema=false] - If true, applies stricter rules (e.g. anyOf for unions) for Structured Outputs
187+
* @param {boolean} [isProperties=false] - If true, the current object is a map of property definitions, so keys should not be filtered
187188
* @returns {Object} The converted schema
188189
*/
189190
_convertSchemaToGemini(obj, isResponseSchema = false, isProperties = false) {
@@ -240,8 +241,7 @@ class FormatConverter {
240241
);
241242
continue;
242243
} else if (hasNull) {
243-
// Only null type?
244-
result.type = "STRING"; // Default to string if only null
244+
// Only null type? Keep it as nullable without forcing a specific type.
245245
continue;
246246
}
247247
}

0 commit comments

Comments
 (0)