ai 2.2.16 → 2.2.18
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/dist/index.d.ts +12 -3
- package/package.json +1 -1
- package/prompts/dist/index.d.ts +2 -2
- package/react/dist/index.d.ts +2 -2
- package/react/dist/index.js +3 -1
- package/react/dist/index.mjs +3 -1
- package/solid/dist/index.d.ts +2 -2
- package/solid/dist/index.js +10 -4
- package/solid/dist/index.mjs +10 -4
- package/svelte/dist/index.d.ts +2 -2
- package/vue/dist/index.d.ts +2 -2
- package/vue/dist/index.js +10 -4
- package/vue/dist/index.mjs +10 -4
package/dist/index.d.ts
CHANGED
@@ -38,7 +38,7 @@ interface Function {
|
|
38
38
|
/**
|
39
39
|
* Shared types between the API and UI packages.
|
40
40
|
*/
|
41
|
-
|
41
|
+
interface Message {
|
42
42
|
id: string;
|
43
43
|
createdAt?: Date;
|
44
44
|
content: string;
|
@@ -54,7 +54,7 @@ type Message = {
|
|
54
54
|
* not be set.
|
55
55
|
*/
|
56
56
|
function_call?: string | FunctionCall;
|
57
|
-
}
|
57
|
+
}
|
58
58
|
type CreateMessage = Omit<Message, 'id'> & {
|
59
59
|
id?: Message['id'];
|
60
60
|
};
|
@@ -550,7 +550,16 @@ interface Prediction {
|
|
550
550
|
declare function ReplicateStream(res: Prediction, cb?: AIStreamCallbacksAndOptions): Promise<ReadableStream>;
|
551
551
|
|
552
552
|
declare const nanoid: (size?: number | undefined) => string;
|
553
|
-
declare function createChunkDecoder(
|
553
|
+
declare function createChunkDecoder(): (chunk: Uint8Array | undefined) => string;
|
554
|
+
declare function createChunkDecoder(complex: false): (chunk: Uint8Array | undefined) => string;
|
555
|
+
declare function createChunkDecoder(complex: true): (chunk: Uint8Array | undefined) => {
|
556
|
+
type: keyof typeof StreamStringPrefixes;
|
557
|
+
value: string;
|
558
|
+
}[];
|
559
|
+
declare function createChunkDecoder(complex?: boolean): (chunk: Uint8Array | undefined) => {
|
560
|
+
type: keyof typeof StreamStringPrefixes;
|
561
|
+
value: string;
|
562
|
+
}[] | string;
|
554
563
|
|
555
564
|
/**
|
556
565
|
* The map of prefixes for data in the stream
|
package/package.json
CHANGED
package/prompts/dist/index.d.ts
CHANGED
@@ -14,7 +14,7 @@ interface FunctionCall {
|
|
14
14
|
/**
|
15
15
|
* Shared types between the API and UI packages.
|
16
16
|
*/
|
17
|
-
|
17
|
+
interface Message {
|
18
18
|
id: string;
|
19
19
|
createdAt?: Date;
|
20
20
|
content: string;
|
@@ -30,7 +30,7 @@ type Message = {
|
|
30
30
|
* not be set.
|
31
31
|
*/
|
32
32
|
function_call?: string | FunctionCall;
|
33
|
-
}
|
33
|
+
}
|
34
34
|
|
35
35
|
/**
|
36
36
|
* A prompt constructor for the HuggingFace StarChat Beta model.
|
package/react/dist/index.d.ts
CHANGED
@@ -36,7 +36,7 @@ interface Function {
|
|
36
36
|
/**
|
37
37
|
* Shared types between the API and UI packages.
|
38
38
|
*/
|
39
|
-
|
39
|
+
interface Message {
|
40
40
|
id: string;
|
41
41
|
createdAt?: Date;
|
42
42
|
content: string;
|
@@ -52,7 +52,7 @@ type Message = {
|
|
52
52
|
* not be set.
|
53
53
|
*/
|
54
54
|
function_call?: string | FunctionCall;
|
55
|
-
}
|
55
|
+
}
|
56
56
|
type CreateMessage = Omit<Message, 'id'> & {
|
57
57
|
id?: Message['id'];
|
58
58
|
};
|
package/react/dist/index.js
CHANGED
@@ -359,8 +359,10 @@ function useChat({
|
|
359
359
|
messagesRef.current,
|
360
360
|
functionCall
|
361
361
|
);
|
362
|
-
if (functionCallResponse === void 0)
|
362
|
+
if (functionCallResponse === void 0) {
|
363
|
+
hasFollowingResponse = false;
|
363
364
|
break;
|
365
|
+
}
|
364
366
|
chatRequest = functionCallResponse;
|
365
367
|
}
|
366
368
|
}
|
package/react/dist/index.mjs
CHANGED
@@ -323,8 +323,10 @@ function useChat({
|
|
323
323
|
messagesRef.current,
|
324
324
|
functionCall
|
325
325
|
);
|
326
|
-
if (functionCallResponse === void 0)
|
326
|
+
if (functionCallResponse === void 0) {
|
327
|
+
hasFollowingResponse = false;
|
327
328
|
break;
|
329
|
+
}
|
328
330
|
chatRequest = functionCallResponse;
|
329
331
|
}
|
330
332
|
}
|
package/solid/dist/index.d.ts
CHANGED
@@ -38,7 +38,7 @@ interface Function {
|
|
38
38
|
/**
|
39
39
|
* Shared types between the API and UI packages.
|
40
40
|
*/
|
41
|
-
|
41
|
+
interface Message {
|
42
42
|
id: string;
|
43
43
|
createdAt?: Date;
|
44
44
|
content: string;
|
@@ -54,7 +54,7 @@ type Message = {
|
|
54
54
|
* not be set.
|
55
55
|
*/
|
56
56
|
function_call?: string | FunctionCall;
|
57
|
-
}
|
57
|
+
}
|
58
58
|
type CreateMessage = Omit<Message, 'id'> & {
|
59
59
|
id?: Message['id'];
|
60
60
|
};
|
package/solid/dist/index.js
CHANGED
@@ -125,10 +125,16 @@ function useChat({
|
|
125
125
|
const res = await fetch(api, {
|
126
126
|
method: "POST",
|
127
127
|
body: JSON.stringify({
|
128
|
-
messages: sendExtraMessageFields ? messagesSnapshot : messagesSnapshot.map(
|
129
|
-
role,
|
130
|
-
|
131
|
-
|
128
|
+
messages: sendExtraMessageFields ? messagesSnapshot : messagesSnapshot.map(
|
129
|
+
({ role, content, name, function_call }) => ({
|
130
|
+
role,
|
131
|
+
content,
|
132
|
+
...name !== void 0 && { name },
|
133
|
+
...function_call !== void 0 && {
|
134
|
+
function_call
|
135
|
+
}
|
136
|
+
})
|
137
|
+
),
|
132
138
|
...body,
|
133
139
|
...options == null ? void 0 : options.body
|
134
140
|
}),
|
package/solid/dist/index.mjs
CHANGED
@@ -98,10 +98,16 @@ function useChat({
|
|
98
98
|
const res = await fetch(api, {
|
99
99
|
method: "POST",
|
100
100
|
body: JSON.stringify({
|
101
|
-
messages: sendExtraMessageFields ? messagesSnapshot : messagesSnapshot.map(
|
102
|
-
role,
|
103
|
-
|
104
|
-
|
101
|
+
messages: sendExtraMessageFields ? messagesSnapshot : messagesSnapshot.map(
|
102
|
+
({ role, content, name, function_call }) => ({
|
103
|
+
role,
|
104
|
+
content,
|
105
|
+
...name !== void 0 && { name },
|
106
|
+
...function_call !== void 0 && {
|
107
|
+
function_call
|
108
|
+
}
|
109
|
+
})
|
110
|
+
),
|
105
111
|
...body,
|
106
112
|
...options == null ? void 0 : options.body
|
107
113
|
}),
|
package/svelte/dist/index.d.ts
CHANGED
@@ -38,7 +38,7 @@ interface Function {
|
|
38
38
|
/**
|
39
39
|
* Shared types between the API and UI packages.
|
40
40
|
*/
|
41
|
-
|
41
|
+
interface Message {
|
42
42
|
id: string;
|
43
43
|
createdAt?: Date;
|
44
44
|
content: string;
|
@@ -54,7 +54,7 @@ type Message = {
|
|
54
54
|
* not be set.
|
55
55
|
*/
|
56
56
|
function_call?: string | FunctionCall;
|
57
|
-
}
|
57
|
+
}
|
58
58
|
type CreateMessage = Omit<Message, 'id'> & {
|
59
59
|
id?: Message['id'];
|
60
60
|
};
|
package/vue/dist/index.d.ts
CHANGED
@@ -38,7 +38,7 @@ interface Function {
|
|
38
38
|
/**
|
39
39
|
* Shared types between the API and UI packages.
|
40
40
|
*/
|
41
|
-
|
41
|
+
interface Message {
|
42
42
|
id: string;
|
43
43
|
createdAt?: Date;
|
44
44
|
content: string;
|
@@ -54,7 +54,7 @@ type Message = {
|
|
54
54
|
* not be set.
|
55
55
|
*/
|
56
56
|
function_call?: string | FunctionCall;
|
57
|
-
}
|
57
|
+
}
|
58
58
|
type CreateMessage = Omit<Message, 'id'> & {
|
59
59
|
id?: Message['id'];
|
60
60
|
};
|
package/vue/dist/index.js
CHANGED
@@ -131,10 +131,16 @@ function useChat({
|
|
131
131
|
const res = await fetch(api, {
|
132
132
|
method: "POST",
|
133
133
|
body: JSON.stringify({
|
134
|
-
messages: sendExtraMessageFields ? messagesSnapshot : messagesSnapshot.map(
|
135
|
-
role,
|
136
|
-
|
137
|
-
|
134
|
+
messages: sendExtraMessageFields ? messagesSnapshot : messagesSnapshot.map(
|
135
|
+
({ role, content, name, function_call }) => ({
|
136
|
+
role,
|
137
|
+
content,
|
138
|
+
...name !== void 0 && { name },
|
139
|
+
...function_call !== void 0 && {
|
140
|
+
function_call
|
141
|
+
}
|
142
|
+
})
|
143
|
+
),
|
138
144
|
...(0, import_vue.unref)(body),
|
139
145
|
// Use unref to unwrap the ref value
|
140
146
|
...options == null ? void 0 : options.body
|
package/vue/dist/index.mjs
CHANGED
@@ -94,10 +94,16 @@ function useChat({
|
|
94
94
|
const res = await fetch(api, {
|
95
95
|
method: "POST",
|
96
96
|
body: JSON.stringify({
|
97
|
-
messages: sendExtraMessageFields ? messagesSnapshot : messagesSnapshot.map(
|
98
|
-
role,
|
99
|
-
|
100
|
-
|
97
|
+
messages: sendExtraMessageFields ? messagesSnapshot : messagesSnapshot.map(
|
98
|
+
({ role, content, name, function_call }) => ({
|
99
|
+
role,
|
100
|
+
content,
|
101
|
+
...name !== void 0 && { name },
|
102
|
+
...function_call !== void 0 && {
|
103
|
+
function_call
|
104
|
+
}
|
105
|
+
})
|
106
|
+
),
|
101
107
|
...unref(body),
|
102
108
|
// Use unref to unwrap the ref value
|
103
109
|
...options == null ? void 0 : options.body
|