@ai-sdk/svelte 3.0.0-beta.27 → 3.0.0-beta.28
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
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @ai-sdk/svelte
|
|
2
2
|
|
|
3
|
+
## 3.0.0-beta.28
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ac34802: Add clear object function to StructuredObject
|
|
8
|
+
- Updated dependencies [ac34802]
|
|
9
|
+
- Updated dependencies [84343eb]
|
|
10
|
+
- Updated dependencies [a753b3a]
|
|
11
|
+
- @ai-sdk/provider-utils@3.0.0-beta.6
|
|
12
|
+
- ai@5.0.0-beta.28
|
|
13
|
+
|
|
3
14
|
## 3.0.0-beta.27
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -76,5 +76,9 @@ export declare class StructuredObject<SCHEMA extends z3.Schema | z4.core.$ZodTyp
|
|
|
76
76
|
* Calls the API with the provided input as JSON body.
|
|
77
77
|
*/
|
|
78
78
|
submit: (input: INPUT) => Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Clears the object state.
|
|
81
|
+
*/
|
|
82
|
+
clear: () => void;
|
|
79
83
|
}
|
|
80
84
|
//# sourceMappingURL=structured-object.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structured-object.svelte.d.ts","sourceRoot":"","sources":["../src/structured-object.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,MAAM,EACZ,MAAM,IAAI,CAAC;AACZ,OAAO,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAQlC,MAAM,MAAM,oCA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IAE3C;;;;OAIG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC,CAAC;AAEF,qBAAa,gBAAgB,CAC3B,MAAM,SAAS,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,GAAG,MAAM,EACpD,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,oCAAoC,CAAC,MAAM,EAAE,MAAM,CAAC;IAUzE;;OAEG;IACH,IAAI,aASF;IAEF;;OAEG;IACH,MAAM,UAAiB,KAAK,mBAqF1B;IAEF;;OAEG;IACH,KAAK,aAGH;CAOH"}
|
|
@@ -56,9 +56,8 @@ export class StructuredObject {
|
|
|
56
56
|
*/
|
|
57
57
|
submit = async (input) => {
|
|
58
58
|
try {
|
|
59
|
-
this.#
|
|
59
|
+
this.#clearObject();
|
|
60
60
|
this.#store.loading = true;
|
|
61
|
-
this.#store.error = undefined;
|
|
62
61
|
const abortController = new AbortController();
|
|
63
62
|
this.#abortController = abortController;
|
|
64
63
|
const actualFetch = this.#options.fetch ?? fetch;
|
|
@@ -120,4 +119,16 @@ export class StructuredObject {
|
|
|
120
119
|
this.#store.error = coalescedError;
|
|
121
120
|
}
|
|
122
121
|
};
|
|
122
|
+
/**
|
|
123
|
+
* Clears the object state.
|
|
124
|
+
*/
|
|
125
|
+
clear = () => {
|
|
126
|
+
this.stop();
|
|
127
|
+
this.#clearObject();
|
|
128
|
+
};
|
|
129
|
+
#clearObject = () => {
|
|
130
|
+
this.#store.object = undefined;
|
|
131
|
+
this.#store.error = undefined;
|
|
132
|
+
this.#store.loading = false;
|
|
133
|
+
};
|
|
123
134
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/svelte",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.28",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"ai": "
|
|
40
|
-
"
|
|
39
|
+
"@ai-sdk/provider-utils": "3.0.0-beta.6",
|
|
40
|
+
"ai": "5.0.0-beta.28"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "20.17.24",
|
|
@@ -152,9 +152,9 @@ export class StructuredObject<
|
|
|
152
152
|
*/
|
|
153
153
|
submit = async (input: INPUT) => {
|
|
154
154
|
try {
|
|
155
|
-
this.#
|
|
155
|
+
this.#clearObject();
|
|
156
|
+
|
|
156
157
|
this.#store.loading = true;
|
|
157
|
-
this.#store.error = undefined;
|
|
158
158
|
|
|
159
159
|
const abortController = new AbortController();
|
|
160
160
|
this.#abortController = abortController;
|
|
@@ -236,4 +236,18 @@ export class StructuredObject<
|
|
|
236
236
|
this.#store.error = coalescedError;
|
|
237
237
|
}
|
|
238
238
|
};
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Clears the object state.
|
|
242
|
+
*/
|
|
243
|
+
clear = () => {
|
|
244
|
+
this.stop();
|
|
245
|
+
this.#clearObject();
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
#clearObject = () => {
|
|
249
|
+
this.#store.object = undefined;
|
|
250
|
+
this.#store.error = undefined;
|
|
251
|
+
this.#store.loading = false;
|
|
252
|
+
};
|
|
239
253
|
}
|