@oh-my-pi/pi-ai 11.5.0 → 11.5.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-ai",
3
- "version": "11.5.0",
3
+ "version": "11.5.1",
4
4
  "description": "Unified LLM API with automatic model discovery and provider configuration",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -63,7 +63,7 @@
63
63
  "@connectrpc/connect-node": "^2.1.1",
64
64
  "@google/genai": "^1.39.0",
65
65
  "@mistralai/mistralai": "^1.13.0",
66
- "@oh-my-pi/pi-utils": "11.5.0",
66
+ "@oh-my-pi/pi-utils": "11.5.1",
67
67
  "@sinclair/typebox": "^0.34.48",
68
68
  "@smithy/node-http-handler": "^4.4.9",
69
69
  "ajv": "^8.17.1",
@@ -332,6 +332,17 @@ function sanitizeSchemaImpl(value: unknown, isInsideProperties: boolean): unknow
332
332
  result[key] = sanitizeSchemaImpl(entry, key === "properties");
333
333
  }
334
334
 
335
+ // Normalize array-valued "type" (e.g. ["string", "null"]) to a single type + nullable.
336
+ // Google's Schema proto expects type to be a single enum string, not an array.
337
+ if (Array.isArray(result.type)) {
338
+ const types = result.type as string[];
339
+ const nonNull = types.filter(t => t !== "null");
340
+ if (types.includes("null")) {
341
+ result.nullable = true;
342
+ }
343
+ result.type = nonNull[0] ?? types[0];
344
+ }
345
+
335
346
  if (constValue !== undefined) {
336
347
  // Convert const to enum, merging with existing enum if present
337
348
  const existingEnum = Array.isArray(result.enum) ? result.enum : [];