@usabledev/usable-chat 1.240.2 → 1.240.4
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/cli.js +27 -10
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -21480,7 +21480,7 @@ var init_model_registry = __esm({
|
|
|
21480
21480
|
var version;
|
|
21481
21481
|
var init_package = __esm({
|
|
21482
21482
|
"package.json"() {
|
|
21483
|
-
version = "1.240.
|
|
21483
|
+
version = "1.240.4";
|
|
21484
21484
|
}
|
|
21485
21485
|
});
|
|
21486
21486
|
|
|
@@ -87347,16 +87347,13 @@ function sanitizeSchemaForGemini(schema) {
|
|
|
87347
87347
|
) {
|
|
87348
87348
|
continue;
|
|
87349
87349
|
}
|
|
87350
|
+
if (!GEMINI_SCHEMA_PASSTHROUGH_KEYS.has(key3)) {
|
|
87351
|
+
continue;
|
|
87352
|
+
}
|
|
87350
87353
|
if (key3 === "properties" && typeof value === "object" && value !== null) {
|
|
87351
|
-
sanitized.properties =
|
|
87352
|
-
for (const [propName3, propValue] of Object.entries(value)) {
|
|
87353
|
-
sanitized.properties[propName3] = sanitizeSchemaForGemini(propValue);
|
|
87354
|
-
}
|
|
87354
|
+
sanitized.properties = sanitizePropertiesForGemini(value);
|
|
87355
87355
|
} else if (key3 === "items") {
|
|
87356
87356
|
sanitized.items = sanitizeSchemaForGemini(value);
|
|
87357
|
-
} else if (typeof value === "object" && !Array.isArray(value)) {
|
|
87358
|
-
;
|
|
87359
|
-
sanitized[key3] = sanitizeSchemaForGemini(value);
|
|
87360
87357
|
} else {
|
|
87361
87358
|
;
|
|
87362
87359
|
sanitized[key3] = value;
|
|
@@ -87371,6 +87368,14 @@ function sanitizeSchemaForGemini(schema) {
|
|
|
87371
87368
|
pruneRequiredFieldsForGemini(sanitized);
|
|
87372
87369
|
return sanitized;
|
|
87373
87370
|
}
|
|
87371
|
+
function sanitizePropertiesForGemini(properties) {
|
|
87372
|
+
const out = {};
|
|
87373
|
+
if (!properties || typeof properties !== "object" || Array.isArray(properties)) return out;
|
|
87374
|
+
for (const [propName3, propValue] of Object.entries(properties)) {
|
|
87375
|
+
out[propName3] = sanitizeSchemaForGemini(propValue);
|
|
87376
|
+
}
|
|
87377
|
+
return out;
|
|
87378
|
+
}
|
|
87374
87379
|
function pruneRequiredFieldsForGemini(schema) {
|
|
87375
87380
|
if (!Array.isArray(schema.required)) return;
|
|
87376
87381
|
if (!schema.properties) {
|
|
@@ -87406,7 +87411,7 @@ function convertToolsToFunctionDeclarations(aiTools) {
|
|
|
87406
87411
|
} else if (params.type === "object" && !params.properties) {
|
|
87407
87412
|
params = { ...params, properties: {} };
|
|
87408
87413
|
}
|
|
87409
|
-
const sanitizedProperties =
|
|
87414
|
+
const sanitizedProperties = sanitizePropertiesForGemini(params.properties);
|
|
87410
87415
|
const declaredRequired = Array.isArray(params.required) ? params.required.filter((reqName) => reqName in sanitizedProperties) : [];
|
|
87411
87416
|
if (Array.isArray(params.required) && declaredRequired.length !== params.required.length) {
|
|
87412
87417
|
const dropped = params.required.filter((n31) => !declaredRequired.includes(n31));
|
|
@@ -87680,7 +87685,7 @@ function extractSystemMessage(messages4) {
|
|
|
87680
87685
|
}
|
|
87681
87686
|
return void 0;
|
|
87682
87687
|
}
|
|
87683
|
-
var GEMINI_THINKING_CONFIG, GEMINI_SIGNATURE_BYPASS;
|
|
87688
|
+
var GEMINI_SCHEMA_PASSTHROUGH_KEYS, GEMINI_THINKING_CONFIG, GEMINI_SIGNATURE_BYPASS;
|
|
87684
87689
|
var init_gemini_wire = __esm({
|
|
87685
87690
|
"src/core/ai/gemini-wire.ts"() {
|
|
87686
87691
|
"use strict";
|
|
@@ -87689,6 +87694,18 @@ var init_gemini_wire = __esm({
|
|
|
87689
87694
|
init_esm();
|
|
87690
87695
|
init_vision_pruning();
|
|
87691
87696
|
init_gemini();
|
|
87697
|
+
GEMINI_SCHEMA_PASSTHROUGH_KEYS = /* @__PURE__ */ new Set([
|
|
87698
|
+
"type",
|
|
87699
|
+
"description",
|
|
87700
|
+
"title",
|
|
87701
|
+
"items",
|
|
87702
|
+
"properties",
|
|
87703
|
+
"required",
|
|
87704
|
+
"nullable",
|
|
87705
|
+
"default",
|
|
87706
|
+
"example",
|
|
87707
|
+
"propertyOrdering"
|
|
87708
|
+
]);
|
|
87692
87709
|
GEMINI_THINKING_CONFIG = { includeThoughts: true };
|
|
87693
87710
|
GEMINI_SIGNATURE_BYPASS = "skip_thought_signature_validator";
|
|
87694
87711
|
}
|