@ai-sdk/svelte 5.0.145 → 5.0.147
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 +19 -0
- package/dist/completion.svelte.d.ts.map +1 -1
- package/dist/completion.svelte.js +5 -1
- package/dist/structured-object.svelte.d.ts.map +1 -1
- package/dist/structured-object.svelte.js +2 -2
- package/package.json +3 -3
- package/src/completion.svelte.ts +5 -1
- package/src/structured-object.svelte.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @ai-sdk/svelte
|
|
2
2
|
|
|
3
|
+
## 5.0.147
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8be2a2b: fix: preserve Headers instance entries in structured-object and completion requests
|
|
8
|
+
- Updated dependencies [66e74dc]
|
|
9
|
+
- ai@7.0.147
|
|
10
|
+
|
|
11
|
+
## 5.0.146
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [0c2a9de]
|
|
16
|
+
- Updated dependencies [200c47f]
|
|
17
|
+
- Updated dependencies [3785b2e]
|
|
18
|
+
- Updated dependencies [ab8eb61]
|
|
19
|
+
- ai@7.0.146
|
|
20
|
+
- @ai-sdk/provider-utils@5.0.64
|
|
21
|
+
|
|
3
22
|
## 5.0.145
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completion.svelte.d.ts","sourceRoot":"","sources":["../src/completion.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EAC1B,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"completion.svelte.d.ts","sourceRoot":"","sources":["../src/completion.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EAC1B,MAAM,IAAI,CAAC;AAQZ,MAAM,MAAM,iBAAiB,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CACpE,oBAAoB,CAAC,IAAI,CAAC,CAC3B,CAAC;AAEF,qBAAa,UAAU,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM;;IASlD,oCAAoC;IACpC,IAAI,UAAU,IAAI,MAAM,CAEvB;IACD,IAAI,UAAU,CAAC,KAAK,EAAE,MAAM,EAE3B;IAED,0CAA0C;IAC1C,IAAI,KAAK,sBAER;IAED,mFAAmF;IACnF,KAAK,SAAqB;IAE1B;;OAEG;IACH,IAAI,OAAO,YAEV;gBAEW,OAAO,GAAE,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAM;IAS1D;;OAEG;IACH,IAAI,aAQF;IAEF;;OAEG;IACH,QAAQ,GAAU,QAAQ,MAAM,EAAE,UAAU,wBAAwB,CAAC,IAAI,CAAC,wCAClC;IAExC,uFAAuF;IACvF,YAAY,GAAU,QAAQ;QAAE,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,mBAK3D;CAsCH"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { callCompletionApi, generateId, } from 'ai';
|
|
2
|
+
import { normalizeHeaders } from '@ai-sdk/provider-utils';
|
|
2
3
|
import { KeyedCompletionStore, getCompletionContext, hasCompletionContext, } from './completion-context.svelte.js';
|
|
3
4
|
export class Completion {
|
|
4
5
|
#options = {};
|
|
@@ -65,7 +66,10 @@ export class Completion {
|
|
|
65
66
|
api: this.#api,
|
|
66
67
|
prompt,
|
|
67
68
|
credentials: this.#options.credentials,
|
|
68
|
-
headers: {
|
|
69
|
+
headers: {
|
|
70
|
+
...normalizeHeaders(this.#options.headers),
|
|
71
|
+
...normalizeHeaders(options?.headers),
|
|
72
|
+
},
|
|
69
73
|
body: {
|
|
70
74
|
...this.#options.body,
|
|
71
75
|
...options?.body,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structured-object.svelte.d.ts","sourceRoot":"","sources":["../src/structured-object.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"structured-object.svelte.d.ts","sourceRoot":"","sources":["../src/structured-object.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,WAAW,EACjB,MAAM,IAAI,CAAC;AAOZ,MAAM,MAAM,uBAAuB,CACjC,MAAM,SAAS,cAAc,EAC7B,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,IAC1B;IACF;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAEnC;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE;QACjB;;;WAGG;QACH,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;QAE3B;;WAEG;QACH,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;KAC1B,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAE3B;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC;IAE3C;;;;OAIG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC,CAAC;AAEF,qBAAa,gBAAgB,CAC3B,MAAM,SAAS,cAAc,EAC7B,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,EAC5B,KAAK,GAAG,OAAO;;IAWf;;OAEG;IACH,IAAI,MAAM,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAE5C;IAKD,0CAA0C;IAC1C,IAAI,KAAK,sBAER;IAED;;OAEG;IACH,IAAI,OAAO,YAEV;gBAEW,OAAO,EAAE,uBAAuB,CAAC,MAAM,EAAE,MAAM,CAAC;IAU5D;;OAEG;IACH,IAAI,aASF;IAEF;;OAEG;IACH,MAAM,GAAU,OAAO,KAAK,mBAqF1B;IAEF;;OAEG;IACH,KAAK,aAGH;CAOH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { generateId, isAbortError, safeValidateTypes, } from '@ai-sdk/provider-utils';
|
|
1
|
+
import { generateId, isAbortError, normalizeHeaders, safeValidateTypes, } from '@ai-sdk/provider-utils';
|
|
2
2
|
import { asSchema, isDeepEqualData, parsePartialJson, } from 'ai';
|
|
3
3
|
import { getStructuredObjectContext, hasStructuredObjectContext, KeyedStructuredObjectStore, } from './structured-object-context.svelte.js';
|
|
4
4
|
export class StructuredObject {
|
|
@@ -65,7 +65,7 @@ export class StructuredObject {
|
|
|
65
65
|
method: 'POST',
|
|
66
66
|
headers: {
|
|
67
67
|
'Content-Type': 'application/json',
|
|
68
|
-
...this.#options.headers,
|
|
68
|
+
...normalizeHeaders(this.#options.headers),
|
|
69
69
|
},
|
|
70
70
|
credentials: this.#options.credentials,
|
|
71
71
|
signal: abortController.signal,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/svelte",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.147",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"svelte": "^5.31.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@ai-sdk/provider-utils": "5.0.
|
|
38
|
-
"ai": "7.0.
|
|
37
|
+
"@ai-sdk/provider-utils": "5.0.64",
|
|
38
|
+
"ai": "7.0.147"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@ai-sdk/test-server": "2.0.4",
|
package/src/completion.svelte.ts
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
type CompletionRequestOptions,
|
|
5
5
|
type UseCompletionOptions,
|
|
6
6
|
} from 'ai';
|
|
7
|
+
import { normalizeHeaders } from '@ai-sdk/provider-utils';
|
|
7
8
|
import {
|
|
8
9
|
KeyedCompletionStore,
|
|
9
10
|
getCompletionContext,
|
|
@@ -90,7 +91,10 @@ export class Completion<BODY extends object = object> {
|
|
|
90
91
|
api: this.#api,
|
|
91
92
|
prompt,
|
|
92
93
|
credentials: this.#options.credentials,
|
|
93
|
-
headers: {
|
|
94
|
+
headers: {
|
|
95
|
+
...normalizeHeaders(this.#options.headers),
|
|
96
|
+
...normalizeHeaders(options?.headers),
|
|
97
|
+
},
|
|
94
98
|
body: {
|
|
95
99
|
...this.#options.body,
|
|
96
100
|
...options?.body,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateId,
|
|
3
3
|
isAbortError,
|
|
4
|
+
normalizeHeaders,
|
|
4
5
|
safeValidateTypes,
|
|
5
6
|
type FetchFunction,
|
|
6
7
|
} from '@ai-sdk/provider-utils';
|
|
@@ -161,7 +162,7 @@ export class StructuredObject<
|
|
|
161
162
|
method: 'POST',
|
|
162
163
|
headers: {
|
|
163
164
|
'Content-Type': 'application/json',
|
|
164
|
-
...this.#options.headers,
|
|
165
|
+
...normalizeHeaders(this.#options.headers),
|
|
165
166
|
},
|
|
166
167
|
credentials: this.#options.credentials,
|
|
167
168
|
signal: abortController.signal,
|