@ai-sdk/svelte 2.1.12 → 3.0.0-alpha.10
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 +354 -24
- package/dist/chat.svelte.d.ts +4 -73
- package/dist/chat.svelte.d.ts.map +1 -1
- package/dist/chat.svelte.js +23 -243
- package/dist/completion.svelte.d.ts +2 -9
- package/dist/completion.svelte.d.ts.map +1 -1
- package/dist/completion.svelte.js +4 -22
- package/dist/context-provider.d.ts.map +1 -1
- package/dist/context-provider.js +0 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/structured-object-context.svelte.d.ts +1 -1
- package/dist/structured-object-context.svelte.d.ts.map +1 -1
- package/dist/structured-object.svelte.d.ts +8 -7
- package/dist/structured-object.svelte.d.ts.map +1 -1
- package/dist/structured-object.svelte.js +5 -6
- package/dist/tests/structured-object-synchronization.svelte +1 -1
- package/dist/tests/structured-object-synchronization.svelte.d.ts +3 -3
- package/dist/tests/structured-object-synchronization.svelte.d.ts.map +1 -1
- package/dist/utils.svelte.js +1 -1
- package/package.json +12 -9
- package/src/chat.svelte.ts +40 -333
- package/src/completion-context.svelte.ts +1 -1
- package/src/completion.svelte.ts +11 -28
- package/src/context-provider.ts +0 -4
- package/src/index.ts +3 -12
- package/src/structured-object-context.svelte.ts +1 -1
- package/src/structured-object.svelte.ts +21 -12
- package/src/tests/structured-object-synchronization.svelte +1 -1
- package/src/utils.svelte.ts +1 -1
- package/dist/chat-context.svelte.d.ts +0 -14
- package/dist/chat-context.svelte.d.ts.map +0 -1
- package/dist/chat-context.svelte.js +0 -13
- package/dist/completion-context.svelte.d.ts +0 -15
- package/dist/completion-context.svelte.d.ts.map +0 -1
- package/dist/tests/chat-synchronization.svelte +0 -12
- package/dist/tests/chat-synchronization.svelte.d.ts +0 -11
- package/dist/tests/chat-synchronization.svelte.d.ts.map +0 -1
- package/src/chat-context.svelte.ts +0 -23
- package/src/tests/chat-synchronization.svelte +0 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,56 +1,386 @@
|
|
|
1
1
|
# @ai-sdk/svelte
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 3.0.0-alpha.10
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 98f25e5: chore (ui): remove managed chat inputs
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [98f25e5]
|
|
12
|
+
- Updated dependencies [7bb58d4]
|
|
13
|
+
- ai@5.0.0-alpha.10
|
|
14
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.10
|
|
15
|
+
|
|
16
|
+
## 3.0.0-alpha.9
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [8255639]
|
|
21
|
+
- Updated dependencies [9ae327d]
|
|
22
|
+
- ai@5.0.0-alpha.9
|
|
23
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.9
|
|
24
|
+
|
|
25
|
+
## 3.0.0-alpha.8
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- Updated dependencies [4fef487]
|
|
30
|
+
- Updated dependencies [6b1c55c]
|
|
31
|
+
- Updated dependencies [2e4f9e4]
|
|
32
|
+
- Updated dependencies [c25cbce]
|
|
33
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.8
|
|
34
|
+
- ai@5.0.0-alpha.8
|
|
35
|
+
|
|
36
|
+
## 3.0.0-alpha.7
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- Updated dependencies [db345da]
|
|
41
|
+
- Updated dependencies [9b0da33]
|
|
42
|
+
- Updated dependencies [247ee0c]
|
|
43
|
+
- ai@5.0.0-alpha.7
|
|
44
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.7
|
|
45
|
+
|
|
46
|
+
## 3.0.0-alpha.6
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- Updated dependencies [0d2c085]
|
|
51
|
+
- Updated dependencies [48a7606]
|
|
52
|
+
- ai@5.0.0-alpha.6
|
|
53
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.6
|
|
54
|
+
|
|
55
|
+
## 3.0.0-alpha.5
|
|
56
|
+
|
|
57
|
+
### Patch Changes
|
|
58
|
+
|
|
59
|
+
- Updated dependencies [655cf3c]
|
|
60
|
+
- Updated dependencies [1675396]
|
|
61
|
+
- Updated dependencies [cf9af6e]
|
|
62
|
+
- Updated dependencies [ef256ed]
|
|
63
|
+
- Updated dependencies [1ed0287]
|
|
64
|
+
- Updated dependencies [825e8d7]
|
|
65
|
+
- Updated dependencies [7324c21]
|
|
66
|
+
- ai@5.0.0-alpha.5
|
|
67
|
+
|
|
68
|
+
## 3.0.0-alpha.4
|
|
69
|
+
|
|
70
|
+
### Patch Changes
|
|
71
|
+
|
|
72
|
+
- Updated dependencies [b32c141]
|
|
73
|
+
- Updated dependencies [72d7d72]
|
|
74
|
+
- Updated dependencies [9315076]
|
|
75
|
+
- Updated dependencies [7d97ab6]
|
|
76
|
+
- Updated dependencies [37a916d]
|
|
77
|
+
- Updated dependencies [5f2b3d4]
|
|
78
|
+
- ai@5.0.0-alpha.4
|
|
79
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.4
|
|
80
|
+
|
|
81
|
+
## 3.0.0-alpha.3
|
|
82
|
+
|
|
83
|
+
### Patch Changes
|
|
84
|
+
|
|
85
|
+
- Updated dependencies [ab7ccef]
|
|
86
|
+
- Updated dependencies [257224b]
|
|
87
|
+
- Updated dependencies [0463011]
|
|
88
|
+
- Updated dependencies [d306260]
|
|
89
|
+
- ai@5.0.0-alpha.3
|
|
90
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.3
|
|
91
|
+
|
|
92
|
+
## 3.0.0-alpha.2
|
|
93
|
+
|
|
94
|
+
### Patch Changes
|
|
95
|
+
|
|
96
|
+
- Updated dependencies [82aa95d]
|
|
97
|
+
- ai@5.0.0-alpha.2
|
|
98
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.2
|
|
99
|
+
|
|
100
|
+
## 3.0.0-alpha.1
|
|
101
|
+
|
|
102
|
+
### Patch Changes
|
|
103
|
+
|
|
104
|
+
- Updated dependencies [b346545]
|
|
105
|
+
- Updated dependencies [109c0ac]
|
|
106
|
+
- ai@5.0.0-alpha.1
|
|
107
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.1
|
|
108
|
+
|
|
109
|
+
## 3.0.0-canary.23
|
|
110
|
+
|
|
111
|
+
### Patch Changes
|
|
112
|
+
|
|
113
|
+
- Updated dependencies [bedb239]
|
|
114
|
+
- Updated dependencies [507ac1d]
|
|
115
|
+
- Updated dependencies [2b9bbcd]
|
|
116
|
+
- Updated dependencies [f7e8bf4]
|
|
117
|
+
- Updated dependencies [cda32ba]
|
|
118
|
+
- Updated dependencies [50f0362]
|
|
119
|
+
- Updated dependencies [ed675de]
|
|
120
|
+
- Updated dependencies [faf8446]
|
|
121
|
+
- Updated dependencies [64f6d64]
|
|
122
|
+
- ai@5.0.0-canary.24
|
|
123
|
+
- @ai-sdk/provider-utils@3.0.0-canary.19
|
|
124
|
+
|
|
125
|
+
## 3.0.0-canary.22
|
|
126
|
+
|
|
127
|
+
### Major Changes
|
|
128
|
+
|
|
129
|
+
- 40acf9b: feat (ui): introduce ChatStore and ChatTransport
|
|
130
|
+
|
|
131
|
+
### Patch Changes
|
|
132
|
+
|
|
133
|
+
- Updated dependencies [40acf9b]
|
|
134
|
+
- @ai-sdk/provider-utils@3.0.0-canary.18
|
|
135
|
+
- ai@5.0.0-canary.23
|
|
136
|
+
|
|
137
|
+
## 3.0.0-canary.21
|
|
138
|
+
|
|
139
|
+
### Patch Changes
|
|
140
|
+
|
|
141
|
+
- Updated dependencies [e7dc6c7]
|
|
142
|
+
- Updated dependencies [a34eb39]
|
|
143
|
+
- Updated dependencies [b33ed7a]
|
|
144
|
+
- Updated dependencies [765f1cd]
|
|
145
|
+
- ai@5.0.0-canary.22
|
|
146
|
+
|
|
147
|
+
## 3.0.0-canary.20
|
|
148
|
+
|
|
149
|
+
### Patch Changes
|
|
150
|
+
|
|
151
|
+
- Updated dependencies [d964901]
|
|
152
|
+
- Updated dependencies [0560977]
|
|
153
|
+
- Updated dependencies [66af894]
|
|
154
|
+
- Updated dependencies [516be5b]
|
|
155
|
+
- Updated dependencies [bfbfc4c]
|
|
156
|
+
- Updated dependencies [ea7a7c9]
|
|
157
|
+
- Updated dependencies [1409e13]
|
|
158
|
+
- ai@5.0.0-canary.21
|
|
159
|
+
- @ai-sdk/provider-utils@3.0.0-canary.17
|
|
160
|
+
|
|
161
|
+
## 3.0.0-canary.19
|
|
162
|
+
|
|
163
|
+
### Major Changes
|
|
164
|
+
|
|
165
|
+
- 496bbc1: chore (ui): inline/remove ChatRequest type
|
|
166
|
+
|
|
167
|
+
### Patch Changes
|
|
168
|
+
|
|
169
|
+
- Updated dependencies [13fef90]
|
|
170
|
+
- Updated dependencies [e90d45d]
|
|
171
|
+
- Updated dependencies [bc3109f]
|
|
172
|
+
- Updated dependencies [496bbc1]
|
|
173
|
+
- Updated dependencies [da70d79]
|
|
174
|
+
- Updated dependencies [bcea599]
|
|
175
|
+
- Updated dependencies [48d675a]
|
|
176
|
+
- Updated dependencies [c7710a9]
|
|
177
|
+
- Updated dependencies [87b828f]
|
|
178
|
+
- Updated dependencies [35fc02c]
|
|
179
|
+
- Updated dependencies [b983b51]
|
|
180
|
+
- ai@5.0.0-canary.20
|
|
181
|
+
- @ai-sdk/provider-utils@3.0.0-canary.16
|
|
182
|
+
|
|
183
|
+
## 3.0.0-canary.18
|
|
184
|
+
|
|
185
|
+
### Patch Changes
|
|
186
|
+
|
|
187
|
+
- Updated dependencies [2d03e19]
|
|
188
|
+
- Updated dependencies [319b989]
|
|
189
|
+
- Updated dependencies [441d042]
|
|
190
|
+
- Updated dependencies [dcc549b]
|
|
191
|
+
- Updated dependencies [cb2b53a]
|
|
192
|
+
- Updated dependencies [e244a78]
|
|
193
|
+
- ai@5.0.0-canary.19
|
|
194
|
+
|
|
195
|
+
## 3.0.0-canary.17
|
|
196
|
+
|
|
197
|
+
### Patch Changes
|
|
198
|
+
|
|
199
|
+
- Updated dependencies [a571d6e]
|
|
200
|
+
- Updated dependencies [c60f895]
|
|
201
|
+
- Updated dependencies [332167b]
|
|
202
|
+
- Updated dependencies [a8c8bd5]
|
|
203
|
+
- Updated dependencies [a662dea]
|
|
204
|
+
- Updated dependencies [41fa418]
|
|
205
|
+
- @ai-sdk/provider-utils@3.0.0-canary.15
|
|
206
|
+
- ai@5.0.0-canary.18
|
|
207
|
+
|
|
208
|
+
## 3.0.0-canary.16
|
|
209
|
+
|
|
210
|
+
### Patch Changes
|
|
211
|
+
|
|
212
|
+
- Updated dependencies [f04fb4a]
|
|
213
|
+
- Updated dependencies [fd1924b]
|
|
214
|
+
- Updated dependencies [957b739]
|
|
215
|
+
- Updated dependencies [fafc3f2]
|
|
216
|
+
- Updated dependencies [c9ad635]
|
|
217
|
+
- Updated dependencies [9bd5ab5]
|
|
218
|
+
- Updated dependencies [92cb0a2]
|
|
219
|
+
- ai@5.0.0-canary.17
|
|
220
|
+
- @ai-sdk/provider-utils@3.0.0-canary.14
|
|
221
|
+
|
|
222
|
+
## 3.0.0-canary.15
|
|
223
|
+
|
|
224
|
+
### Patch Changes
|
|
225
|
+
|
|
226
|
+
- Updated dependencies [ec78cdc]
|
|
227
|
+
- Updated dependencies [9b4d074]
|
|
228
|
+
- Updated dependencies [8b86e99]
|
|
229
|
+
- Updated dependencies [28ad69e]
|
|
230
|
+
- Updated dependencies [2524fc7]
|
|
231
|
+
- Updated dependencies [ec5933d]
|
|
232
|
+
- Updated dependencies [175b868]
|
|
233
|
+
- ai@5.0.0-canary.16
|
|
234
|
+
|
|
235
|
+
## 3.0.0-canary.14
|
|
236
|
+
|
|
237
|
+
### Patch Changes
|
|
238
|
+
|
|
239
|
+
- Updated dependencies [d9209ca]
|
|
240
|
+
- Updated dependencies [ea27cc6]
|
|
241
|
+
- Updated dependencies [0ff02bb]
|
|
242
|
+
- Updated dependencies [4bfe9ec]
|
|
243
|
+
- Updated dependencies [2877a74]
|
|
244
|
+
- ai@5.0.0-canary.15
|
|
245
|
+
- @ai-sdk/provider-utils@3.0.0-canary.13
|
|
246
|
+
|
|
247
|
+
## 3.0.0-canary.13
|
|
248
|
+
|
|
249
|
+
### Patch Changes
|
|
250
|
+
|
|
251
|
+
- Updated dependencies [9bf7291]
|
|
252
|
+
- Updated dependencies [4617fab]
|
|
253
|
+
- Updated dependencies [a76a62b]
|
|
254
|
+
- ai@5.0.0-canary.14
|
|
255
|
+
- @ai-sdk/provider-utils@3.0.0-canary.12
|
|
256
|
+
|
|
257
|
+
## 3.0.0-canary.12
|
|
258
|
+
|
|
259
|
+
### Patch Changes
|
|
260
|
+
|
|
261
|
+
- Updated dependencies [14cb3be]
|
|
262
|
+
- Updated dependencies [66962ed]
|
|
263
|
+
- Updated dependencies [9301f86]
|
|
264
|
+
- ai@5.0.0-canary.13
|
|
265
|
+
- @ai-sdk/provider-utils@3.0.0-canary.11
|
|
266
|
+
|
|
267
|
+
## 3.0.0-canary.11
|
|
268
|
+
|
|
269
|
+
### Patch Changes
|
|
270
|
+
|
|
271
|
+
- ai@5.0.0-canary.12
|
|
272
|
+
- @ai-sdk/provider-utils@3.0.0-canary.10
|
|
273
|
+
|
|
274
|
+
## 3.0.0-canary.10
|
|
275
|
+
|
|
276
|
+
### Patch Changes
|
|
277
|
+
|
|
278
|
+
- Updated dependencies [8e64e9c]
|
|
279
|
+
- ai@5.0.0-canary.11
|
|
280
|
+
- @ai-sdk/provider-utils@3.0.0-canary.9
|
|
281
|
+
|
|
282
|
+
## 3.0.0-canary.9
|
|
4
283
|
|
|
5
284
|
### Patch Changes
|
|
6
285
|
|
|
7
|
-
- Updated dependencies [
|
|
8
|
-
|
|
9
|
-
-
|
|
286
|
+
- Updated dependencies [d8aeaef]
|
|
287
|
+
- Updated dependencies [3e10408]
|
|
288
|
+
- ai@5.0.0-canary.10
|
|
10
289
|
|
|
11
|
-
##
|
|
290
|
+
## 3.0.0-canary.8
|
|
12
291
|
|
|
13
292
|
### Patch Changes
|
|
14
293
|
|
|
15
|
-
- Updated dependencies [
|
|
16
|
-
|
|
294
|
+
- Updated dependencies [a847c3e]
|
|
295
|
+
- Updated dependencies [5d142ab]
|
|
296
|
+
- Updated dependencies [cb9c9e4]
|
|
297
|
+
- Updated dependencies [8aa9e20]
|
|
298
|
+
- Updated dependencies [b32e192]
|
|
299
|
+
- ai@5.0.0-canary.9
|
|
300
|
+
- @ai-sdk/provider-utils@3.0.0-canary.8
|
|
17
301
|
|
|
18
|
-
##
|
|
302
|
+
## 3.0.0-canary.7
|
|
19
303
|
|
|
20
304
|
### Patch Changes
|
|
21
305
|
|
|
22
|
-
- Updated dependencies [
|
|
23
|
-
|
|
306
|
+
- Updated dependencies [5d1e3ba]
|
|
307
|
+
- Updated dependencies [26735b5]
|
|
308
|
+
- Updated dependencies [14c9410]
|
|
309
|
+
- Updated dependencies [7827a49]
|
|
310
|
+
- Updated dependencies [bd8a36c]
|
|
311
|
+
- Updated dependencies [b6f9f3c]
|
|
312
|
+
- Updated dependencies [92c8e66]
|
|
313
|
+
- Updated dependencies [fd65bc6]
|
|
314
|
+
- Updated dependencies [5bdff05]
|
|
315
|
+
- ai@5.0.0-canary.8
|
|
316
|
+
- @ai-sdk/provider-utils@3.0.0-canary.7
|
|
24
317
|
|
|
25
|
-
##
|
|
318
|
+
## 3.0.0-canary.6
|
|
26
319
|
|
|
27
320
|
### Patch Changes
|
|
28
321
|
|
|
29
|
-
-
|
|
30
|
-
-
|
|
322
|
+
- Updated dependencies [0b78e17]
|
|
323
|
+
- Updated dependencies [6fba4c7]
|
|
324
|
+
- Updated dependencies [3e3b9df]
|
|
325
|
+
- Updated dependencies [1766ede]
|
|
326
|
+
- Updated dependencies [f10304b]
|
|
327
|
+
- ai@5.0.0-canary.7
|
|
328
|
+
- @ai-sdk/provider-utils@3.0.0-canary.6
|
|
31
329
|
|
|
32
|
-
##
|
|
330
|
+
## 3.0.0-canary.5
|
|
33
331
|
|
|
34
332
|
### Patch Changes
|
|
35
333
|
|
|
36
|
-
-
|
|
37
|
-
- @ai-sdk/
|
|
334
|
+
- ai@5.0.0-canary.6
|
|
335
|
+
- @ai-sdk/provider-utils@3.0.0-canary.5
|
|
38
336
|
|
|
39
|
-
##
|
|
337
|
+
## 3.0.0-canary.4
|
|
40
338
|
|
|
41
339
|
### Patch Changes
|
|
42
340
|
|
|
43
|
-
- Updated dependencies [
|
|
44
|
-
|
|
45
|
-
-
|
|
341
|
+
- Updated dependencies [b71fe8d]
|
|
342
|
+
- Updated dependencies [d91b50d]
|
|
343
|
+
- ai@5.0.0-canary.5
|
|
344
|
+
- @ai-sdk/provider-utils@3.0.0-canary.4
|
|
345
|
+
|
|
346
|
+
## 3.0.0-canary.3
|
|
347
|
+
|
|
348
|
+
### Patch Changes
|
|
349
|
+
|
|
350
|
+
- Updated dependencies [a166433]
|
|
351
|
+
- Updated dependencies [9f95b35]
|
|
352
|
+
- @ai-sdk/provider-utils@3.0.0-canary.3
|
|
353
|
+
- @ai-sdk/ui-utils@2.0.0-canary.3
|
|
354
|
+
|
|
355
|
+
## 3.0.0-canary.2
|
|
356
|
+
|
|
357
|
+
### Patch Changes
|
|
358
|
+
|
|
359
|
+
- @ai-sdk/provider-utils@3.0.0-canary.2
|
|
360
|
+
- @ai-sdk/ui-utils@2.0.0-canary.2
|
|
361
|
+
|
|
362
|
+
## 3.0.0-canary.1
|
|
363
|
+
|
|
364
|
+
### Patch Changes
|
|
365
|
+
|
|
366
|
+
- Updated dependencies [060370c]
|
|
367
|
+
- Updated dependencies [0c0c0b3]
|
|
368
|
+
- Updated dependencies [63d791d]
|
|
369
|
+
- @ai-sdk/provider-utils@3.0.0-canary.1
|
|
370
|
+
- @ai-sdk/ui-utils@2.0.0-canary.1
|
|
371
|
+
|
|
372
|
+
## 3.0.0-canary.0
|
|
373
|
+
|
|
374
|
+
### Major Changes
|
|
46
375
|
|
|
47
|
-
|
|
376
|
+
- d5f588f: AI SDK 5
|
|
48
377
|
|
|
49
378
|
### Patch Changes
|
|
50
379
|
|
|
51
|
-
- Updated dependencies [
|
|
52
|
-
|
|
53
|
-
- @ai-sdk/
|
|
380
|
+
- Updated dependencies [d5f588f]
|
|
381
|
+
- Updated dependencies [9477ebb]
|
|
382
|
+
- @ai-sdk/provider-utils@3.0.0-canary.0
|
|
383
|
+
- @ai-sdk/ui-utils@2.0.0-canary.0
|
|
54
384
|
|
|
55
385
|
## 2.1.5
|
|
56
386
|
|
package/dist/chat.svelte.d.ts
CHANGED
|
@@ -1,75 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* Must be at least 1.
|
|
6
|
-
* A maximum number is required to prevent infinite loops in the case of misconfigured tools.
|
|
7
|
-
* By default, it's set to 1, which means that only a single LLM call is made.
|
|
8
|
-
* @default 1
|
|
9
|
-
*/
|
|
10
|
-
maxSteps?: number;
|
|
11
|
-
}>;
|
|
12
|
-
export type { CreateMessage, Message, UIMessage };
|
|
13
|
-
export declare class Chat {
|
|
14
|
-
#private;
|
|
15
|
-
/**
|
|
16
|
-
* The id of the chat. If not provided through the constructor, a random ID will be generated
|
|
17
|
-
* using the provided `generateId` function, or a built-in function if not provided.
|
|
18
|
-
*/
|
|
19
|
-
readonly id: string;
|
|
20
|
-
/**
|
|
21
|
-
* Additional data added on the server via StreamData.
|
|
22
|
-
*
|
|
23
|
-
* This is writable, so you can use it to transform or clear the chat data.
|
|
24
|
-
*/
|
|
25
|
-
get data(): JSONValue[] | undefined;
|
|
26
|
-
set data(value: JSONValue[] | undefined);
|
|
27
|
-
/**
|
|
28
|
-
* Hook status:
|
|
29
|
-
*
|
|
30
|
-
* - `submitted`: The message has been sent to the API and we're awaiting the start of the response stream.
|
|
31
|
-
* - `streaming`: The response is actively streaming in from the API, receiving chunks of data.
|
|
32
|
-
* - `ready`: The full response has been received and processed; a new user message can be submitted.
|
|
33
|
-
* - `error`: An error occurred during the API request, preventing successful completion.
|
|
34
|
-
*/
|
|
35
|
-
get status(): "submitted" | "streaming" | "ready" | "error";
|
|
36
|
-
/** The error object of the API request */
|
|
37
|
-
get error(): Error | undefined;
|
|
38
|
-
/** The current value of the input. Writable, so it can be bound to form inputs. */
|
|
39
|
-
input: string;
|
|
40
|
-
/**
|
|
41
|
-
* Current messages in the chat.
|
|
42
|
-
*
|
|
43
|
-
* This is writable, which is useful when you want to edit the messages on the client, and then
|
|
44
|
-
* trigger {@link reload} to regenerate the AI response.
|
|
45
|
-
*/
|
|
46
|
-
get messages(): UIMessage[];
|
|
47
|
-
set messages(value: Message[]);
|
|
48
|
-
constructor(options?: ChatOptions);
|
|
49
|
-
/**
|
|
50
|
-
* Append a user message to the chat list. This triggers the API call to fetch
|
|
51
|
-
* the assistant's response.
|
|
52
|
-
* @param message The message to append
|
|
53
|
-
* @param options Additional options to pass to the API call
|
|
54
|
-
*/
|
|
55
|
-
append: (message: Message | CreateMessage, { data, headers, body, experimental_attachments }?: ChatRequestOptions) => Promise<void>;
|
|
56
|
-
/**
|
|
57
|
-
* Reload the last AI chat response for the given chat history. If the last
|
|
58
|
-
* message isn't from the assistant, it will request the API to generate a
|
|
59
|
-
* new response.
|
|
60
|
-
*/
|
|
61
|
-
reload: ({ data, headers, body }?: ChatRequestOptions) => Promise<void>;
|
|
62
|
-
/**
|
|
63
|
-
* Abort the current request immediately, keep the generated tokens if any.
|
|
64
|
-
*/
|
|
65
|
-
stop: () => void;
|
|
66
|
-
/** Form submission handler to automatically reset input and append a user message */
|
|
67
|
-
handleSubmit: (event?: {
|
|
68
|
-
preventDefault?: () => void;
|
|
69
|
-
}, options?: ChatRequestOptions) => Promise<void>;
|
|
70
|
-
addToolResult: ({ toolCallId, result, }: {
|
|
71
|
-
toolCallId: string;
|
|
72
|
-
result: unknown;
|
|
73
|
-
}) => Promise<void>;
|
|
1
|
+
import { AbstractChat, type ChatInit, type CreateUIMessage, type UIDataPartSchemas, type UIMessage } from 'ai';
|
|
2
|
+
export type { CreateUIMessage, UIMessage };
|
|
3
|
+
export declare class Chat<MESSAGE_METADATA = unknown, DATA_PART_SCHEMAS extends UIDataPartSchemas = UIDataPartSchemas> extends AbstractChat<MESSAGE_METADATA, DATA_PART_SCHEMAS> {
|
|
4
|
+
constructor(init: ChatInit<MESSAGE_METADATA, DATA_PART_SCHEMAS>);
|
|
74
5
|
}
|
|
75
6
|
//# sourceMappingURL=chat.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.svelte.d.ts","sourceRoot":"","sources":["../src/chat.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"chat.svelte.d.ts","sourceRoot":"","sources":["../src/chat.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,QAAQ,EAGb,KAAK,eAAe,EACpB,KAAK,iBAAiB,EAEtB,KAAK,SAAS,EACf,MAAM,IAAI,CAAC;AAEZ,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,CAAC;AAE3C,qBAAa,IAAI,CACf,gBAAgB,GAAG,OAAO,EAC1B,iBAAiB,SAAS,iBAAiB,GAAG,iBAAiB,CAC/D,SAAQ,YAAY,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;gBAC7C,IAAI,EAAE,QAAQ,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;CAMhE"}
|