@ai-sdk/gateway 4.0.107 → 4.0.108
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 +18 -0
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/gateway-decision-model.ts +20 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @ai-sdk/gateway
|
|
2
2
|
|
|
3
|
+
## 4.0.108
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9184a35: Add ordered text, file, and JSON parts to experimental decision state. Support image input in OpenAI Decisions and language model adapters. Gateway retains its existing string and JSON request format and rejects files, as does TypeSafe AI.
|
|
8
|
+
|
|
9
|
+
Arrays passed directly as state now contain decision state parts. Wrap JSON arrays in an object or a json part.
|
|
10
|
+
|
|
11
|
+
Normalize all public state forms into an array of parts before calling decision providers. Providers receive text and JSON objects as text and json parts.
|
|
12
|
+
|
|
13
|
+
Serialize decision file bytes as base64 in OpenTelemetry state attributes. Model-call spans record normalized state parts, while outer spans retain public state inputs.
|
|
14
|
+
|
|
15
|
+
Preserve native JSON state in TypeSafe AI when state contains one JSON part. Label shared state in language-model decision prompts.
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [9184a35]
|
|
18
|
+
- @ai-sdk/provider@4.0.25
|
|
19
|
+
- @ai-sdk/provider-utils@5.0.57
|
|
20
|
+
|
|
3
21
|
## 4.0.107
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -1837,6 +1837,11 @@ var GatewayDecisionModel = class {
|
|
|
1837
1837
|
return this.doDecide(options);
|
|
1838
1838
|
}
|
|
1839
1839
|
async doDecide({ state, questions, headers, abortSignal, providerOptions }) {
|
|
1840
|
+
const values = state.map((part) => {
|
|
1841
|
+
if (part.type === "file") throw new UnsupportedFunctionalityError({ functionality: "Gateway decision file input" });
|
|
1842
|
+
return part.type === "text" ? part.text : part.value;
|
|
1843
|
+
});
|
|
1844
|
+
const requestState = values.length === 1 && (typeof values[0] === "string" || typeof values[0] === "object" && values[0] !== null) ? values[0] : values;
|
|
1840
1845
|
const gatewayOptions = await parseProviderOptions({
|
|
1841
1846
|
provider: "gateway",
|
|
1842
1847
|
providerOptions,
|
|
@@ -1852,7 +1857,7 @@ var GatewayDecisionModel = class {
|
|
|
1852
1857
|
url: this.getUrl(),
|
|
1853
1858
|
headers: combineHeaders(resolvedHeaders, headers ?? {}, this.getModelConfigHeaders(), await resolve(this.config.o11yHeaders)),
|
|
1854
1859
|
body: {
|
|
1855
|
-
state,
|
|
1860
|
+
state: requestState,
|
|
1856
1861
|
questions,
|
|
1857
1862
|
...validatedProviderOptions ? { providerOptions: validatedProviderOptions } : {}
|
|
1858
1863
|
},
|
|
@@ -3034,7 +3039,7 @@ async function getVercelRequestId() {
|
|
|
3034
3039
|
}
|
|
3035
3040
|
//#endregion
|
|
3036
3041
|
//#region src/version.ts
|
|
3037
|
-
const VERSION = "4.0.
|
|
3042
|
+
const VERSION = "4.0.108";
|
|
3038
3043
|
//#endregion
|
|
3039
3044
|
//#region src/gateway-provider.ts
|
|
3040
3045
|
const AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|