ai 2.2.11 → 2.2.13
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/package.json +1 -1
- package/react/dist/index.js +2 -0
- package/react/dist/index.mjs +2 -0
- package/solid/dist/index.js +2 -0
- package/solid/dist/index.mjs +2 -0
- package/svelte/dist/index.js +2 -0
- package/svelte/dist/index.mjs +2 -0
- package/vue/dist/index.js +3 -1
- package/vue/dist/index.mjs +4 -2
package/package.json
CHANGED
package/react/dist/index.js
CHANGED
@@ -327,6 +327,7 @@ function useChat({
|
|
327
327
|
async (chatRequest) => {
|
328
328
|
try {
|
329
329
|
mutateLoading(true);
|
330
|
+
setError(void 0);
|
330
331
|
const abortController = new AbortController();
|
331
332
|
abortControllerRef.current = abortController;
|
332
333
|
while (true) {
|
@@ -550,6 +551,7 @@ function useCompletion({
|
|
550
551
|
async (prompt, options) => {
|
551
552
|
try {
|
552
553
|
mutateLoading(true);
|
554
|
+
setError(void 0);
|
553
555
|
const abortController2 = new AbortController();
|
554
556
|
setAbortController(abortController2);
|
555
557
|
mutate("", false);
|
package/react/dist/index.mjs
CHANGED
@@ -291,6 +291,7 @@ function useChat({
|
|
291
291
|
async (chatRequest) => {
|
292
292
|
try {
|
293
293
|
mutateLoading(true);
|
294
|
+
setError(void 0);
|
294
295
|
const abortController = new AbortController();
|
295
296
|
abortControllerRef.current = abortController;
|
296
297
|
while (true) {
|
@@ -514,6 +515,7 @@ function useCompletion({
|
|
514
515
|
async (prompt, options) => {
|
515
516
|
try {
|
516
517
|
mutateLoading(true);
|
518
|
+
setError(void 0);
|
517
519
|
const abortController2 = new AbortController();
|
518
520
|
setAbortController(abortController2);
|
519
521
|
mutate("", false);
|
package/solid/dist/index.js
CHANGED
@@ -115,6 +115,7 @@ function useChat({
|
|
115
115
|
let abortController = null;
|
116
116
|
async function triggerRequest(messagesSnapshot, options) {
|
117
117
|
try {
|
118
|
+
setError(void 0);
|
118
119
|
setIsLoading(true);
|
119
120
|
abortController = new AbortController();
|
120
121
|
const previousMessages = chatApiStore.get([key], {
|
@@ -307,6 +308,7 @@ function useCompletion({
|
|
307
308
|
let abortController = null;
|
308
309
|
async function triggerRequest(prompt, options) {
|
309
310
|
try {
|
311
|
+
setError(void 0);
|
310
312
|
setIsLoading(true);
|
311
313
|
abortController = new AbortController();
|
312
314
|
mutate("");
|
package/solid/dist/index.mjs
CHANGED
@@ -88,6 +88,7 @@ function useChat({
|
|
88
88
|
let abortController = null;
|
89
89
|
async function triggerRequest(messagesSnapshot, options) {
|
90
90
|
try {
|
91
|
+
setError(void 0);
|
91
92
|
setIsLoading(true);
|
92
93
|
abortController = new AbortController();
|
93
94
|
const previousMessages = chatApiStore.get([key], {
|
@@ -280,6 +281,7 @@ function useCompletion({
|
|
280
281
|
let abortController = null;
|
281
282
|
async function triggerRequest(prompt, options) {
|
282
283
|
try {
|
284
|
+
setError(void 0);
|
283
285
|
setIsLoading(true);
|
284
286
|
abortController = new AbortController();
|
285
287
|
mutate("");
|
package/svelte/dist/index.js
CHANGED
@@ -709,6 +709,7 @@ function useChat({
|
|
709
709
|
const error = (0, import_store.writable)(void 0);
|
710
710
|
async function triggerRequest(chatRequest) {
|
711
711
|
try {
|
712
|
+
error.set(void 0);
|
712
713
|
loading.set(true);
|
713
714
|
abortController = new AbortController();
|
714
715
|
while (true) {
|
@@ -868,6 +869,7 @@ function useCompletion({
|
|
868
869
|
let abortController = null;
|
869
870
|
async function triggerRequest(prompt, options) {
|
870
871
|
try {
|
872
|
+
error.set(void 0);
|
871
873
|
loading.set(true);
|
872
874
|
abortController = new AbortController();
|
873
875
|
mutate("");
|
package/svelte/dist/index.mjs
CHANGED
@@ -682,6 +682,7 @@ function useChat({
|
|
682
682
|
const error = writable(void 0);
|
683
683
|
async function triggerRequest(chatRequest) {
|
684
684
|
try {
|
685
|
+
error.set(void 0);
|
685
686
|
loading.set(true);
|
686
687
|
abortController = new AbortController();
|
687
688
|
while (true) {
|
@@ -841,6 +842,7 @@ function useCompletion({
|
|
841
842
|
let abortController = null;
|
842
843
|
async function triggerRequest(prompt, options) {
|
843
844
|
try {
|
845
|
+
error.set(void 0);
|
844
846
|
loading.set(true);
|
845
847
|
abortController = new AbortController();
|
846
848
|
mutate("");
|
package/vue/dist/index.js
CHANGED
@@ -123,6 +123,7 @@ function useChat({
|
|
123
123
|
let abortController = null;
|
124
124
|
async function triggerRequest(messagesSnapshot, options) {
|
125
125
|
try {
|
126
|
+
error.value = void 0;
|
126
127
|
mutateLoading(() => true);
|
127
128
|
abortController = new AbortController();
|
128
129
|
const previousMessages = messages.value;
|
@@ -302,6 +303,7 @@ function useCompletion({
|
|
302
303
|
let abortController = null;
|
303
304
|
async function triggerRequest(prompt, options) {
|
304
305
|
try {
|
306
|
+
error.value = void 0;
|
305
307
|
mutateLoading(() => true);
|
306
308
|
abortController = new AbortController();
|
307
309
|
mutate("");
|
@@ -309,7 +311,7 @@ function useCompletion({
|
|
309
311
|
method: "POST",
|
310
312
|
body: JSON.stringify({
|
311
313
|
prompt,
|
312
|
-
...body,
|
314
|
+
...(0, import_vue2.unref)(body),
|
313
315
|
...options == null ? void 0 : options.body
|
314
316
|
}),
|
315
317
|
headers: {
|
package/vue/dist/index.mjs
CHANGED
@@ -86,6 +86,7 @@ function useChat({
|
|
86
86
|
let abortController = null;
|
87
87
|
async function triggerRequest(messagesSnapshot, options) {
|
88
88
|
try {
|
89
|
+
error.value = void 0;
|
89
90
|
mutateLoading(() => true);
|
90
91
|
abortController = new AbortController();
|
91
92
|
const previousMessages = messages.value;
|
@@ -227,7 +228,7 @@ function useChat({
|
|
227
228
|
|
228
229
|
// vue/use-completion.ts
|
229
230
|
import swrv2 from "swrv";
|
230
|
-
import { ref as ref2 } from "vue";
|
231
|
+
import { ref as ref2, unref as unref2 } from "vue";
|
231
232
|
var uniqueId2 = 0;
|
232
233
|
var useSWRV2 = swrv2.default || swrv2;
|
233
234
|
var store2 = {};
|
@@ -265,6 +266,7 @@ function useCompletion({
|
|
265
266
|
let abortController = null;
|
266
267
|
async function triggerRequest(prompt, options) {
|
267
268
|
try {
|
269
|
+
error.value = void 0;
|
268
270
|
mutateLoading(() => true);
|
269
271
|
abortController = new AbortController();
|
270
272
|
mutate("");
|
@@ -272,7 +274,7 @@ function useCompletion({
|
|
272
274
|
method: "POST",
|
273
275
|
body: JSON.stringify({
|
274
276
|
prompt,
|
275
|
-
...body,
|
277
|
+
...unref2(body),
|
276
278
|
...options == null ? void 0 : options.body
|
277
279
|
}),
|
278
280
|
headers: {
|