@combycode/llm-sdk 2.2.1 → 2.2.2

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/CHANGELOG.md CHANGED
@@ -4,6 +4,30 @@ All notable changes to `@combycode/llm-sdk` are documented here. The format foll
4
4
  [Keep a Changelog](https://keepachangelog.com/) and the project adheres to
5
5
  [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## [2.2.2] — 2026-08-17
8
+
9
+ ### Fixed
10
+
11
+ - **Every Gemini model rejected any tool schema carrying `additionalProperties`.** Function
12
+ declarations were sent on Gemini's `parameters` field, which takes a narrow OpenAPI subset and
13
+ rejects anything outside it outright:
14
+
15
+ > `Invalid JSON payload received. Unknown name "additionalProperties" at 'tools[0].function_declarations[0].parameters'`
16
+
17
+ Since OpenAI strict mode *requires* `additionalProperties: false`, no single tool manifest could
18
+ satisfy both providers — a consuming app had to delete the property, degrading its OpenAI schema,
19
+ to keep Google working. Measured against the live API, the narrow field also rejects `$schema`,
20
+ `$ref`, `$defs`, `definitions`, `const`, `examples`, `exclusiveMinimum`/`Maximum`, `multipleOf`,
21
+ `uniqueItems`, `patternProperties`, `propertyNames`, `if`/`then`, `readOnly`, `deprecated`, and
22
+ `type` given as an array.
23
+
24
+ Schemas now go on `parametersJsonSchema`, which takes full JSON Schema unchanged. Sanitising into
25
+ the subset was the obvious alternative and is worse: it silently drops constraints and cannot
26
+ express a `$ref` at all. Verified end to end on every tool-capable model the catalog ships —
27
+ gemini 2.5 pro/flash/flash-lite, 3-flash, 3.1-pro (incl. customtools), 3.1-flash-lite,
28
+ 3.5-flash/-lite, 3.6-flash, gemma-4-26b/-31b: 11/11 fail before the change and drive the tool
29
+ after it. The Interactions surface already accepted full JSON Schema and is unchanged.
30
+
7
31
  ## [2.2.1] — 2026-08-17
8
32
 
9
33
  ### Fixed
@@ -27103,7 +27103,30 @@ var GoogleAdapter = class {
27103
27103
  functionDeclarations: fnTools.map((t) => ({
27104
27104
  name: t.name,
27105
27105
  description: t.description,
27106
- parameters: t.parameters
27106
+ // `parametersJsonSchema`, NOT `parameters`. The two are mutually exclusive
27107
+ // (sending both is a 400) and accept different things:
27108
+ //
27109
+ // parameters a narrow OpenAPI subset. Anything outside it is
27110
+ // rejected outright with `Unknown name "<keyword>"` —
27111
+ // measured: additionalProperties (at any depth),
27112
+ // $schema, $ref, $defs, definitions, const, examples,
27113
+ // exclusiveMinimum/Maximum, multipleOf, uniqueItems,
27114
+ // patternProperties, propertyNames, if/then,
27115
+ // readOnly, deprecated, and `type` as an array.
27116
+ // parametersJsonSchema full JSON Schema.
27117
+ //
27118
+ // We passed callers' schemas straight into `parameters`, so any tool defined
27119
+ // with `additionalProperties: false` — which OpenAI's strict mode requires —
27120
+ // failed on EVERY Gemini model. A consuming app had to delete it from its
27121
+ // manifest, degrading its OpenAI schema to keep Google working.
27122
+ //
27123
+ // Sanitising into the subset was the obvious fix and is the wrong one: it
27124
+ // silently drops constraints and cannot express a `$ref` at all. Verified on
27125
+ // every tool-capable model we ship (2.5 pro/flash/flash-lite, 3-flash,
27126
+ // 3.1-pro incl. customtools, 3.1-flash-lite, 3.5-flash/-lite, 3.6-flash,
27127
+ // gemma-4-26b/-31b) that this field takes the schema unchanged and the model
27128
+ // still calls the tool.
27129
+ parametersJsonSchema: t.parameters
27107
27130
  }))
27108
27131
  });
27109
27132
  }
package/dist/index.js CHANGED
@@ -27030,7 +27030,30 @@ var GoogleAdapter = class {
27030
27030
  functionDeclarations: fnTools.map((t) => ({
27031
27031
  name: t.name,
27032
27032
  description: t.description,
27033
- parameters: t.parameters
27033
+ // `parametersJsonSchema`, NOT `parameters`. The two are mutually exclusive
27034
+ // (sending both is a 400) and accept different things:
27035
+ //
27036
+ // parameters a narrow OpenAPI subset. Anything outside it is
27037
+ // rejected outright with `Unknown name "<keyword>"` —
27038
+ // measured: additionalProperties (at any depth),
27039
+ // $schema, $ref, $defs, definitions, const, examples,
27040
+ // exclusiveMinimum/Maximum, multipleOf, uniqueItems,
27041
+ // patternProperties, propertyNames, if/then,
27042
+ // readOnly, deprecated, and `type` as an array.
27043
+ // parametersJsonSchema full JSON Schema.
27044
+ //
27045
+ // We passed callers' schemas straight into `parameters`, so any tool defined
27046
+ // with `additionalProperties: false` — which OpenAI's strict mode requires —
27047
+ // failed on EVERY Gemini model. A consuming app had to delete it from its
27048
+ // manifest, degrading its OpenAI schema to keep Google working.
27049
+ //
27050
+ // Sanitising into the subset was the obvious fix and is the wrong one: it
27051
+ // silently drops constraints and cannot express a `$ref` at all. Verified on
27052
+ // every tool-capable model we ship (2.5 pro/flash/flash-lite, 3-flash,
27053
+ // 3.1-pro incl. customtools, 3.1-flash-lite, 3.5-flash/-lite, 3.6-flash,
27054
+ // gemma-4-26b/-31b) that this field takes the schema unchanged and the model
27055
+ // still calls the tool.
27056
+ parametersJsonSchema: t.parameters
27034
27057
  }))
27035
27058
  });
27036
27059
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@combycode/llm-sdk",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "description": "Unified, pluggable AI SDK for accessing the LLMs of every major provider (Anthropic, OpenAI, Google, xAI, OpenRouter) through one API. Cross-environment: Node, Bun, and the browser.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",