vue-llm 0.4.0 → 1.0.0
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/README.md +146 -2
- package/dist/components/StreamMarkdown.vue.d.ts +1 -0
- package/dist/components.cjs +6 -1
- package/dist/components.d.ts +1 -0
- package/dist/components.js +125 -17
- package/dist/composables/use-chat.d.ts +11 -6
- package/dist/composables/use-completion.d.ts +2 -2
- package/dist/composables/use-object.d.ts +2 -2
- package/dist/composables/use-prompt.d.ts +3 -0
- package/dist/core/errors.d.ts +16 -0
- package/dist/core/markdown.d.ts +3 -0
- package/dist/core/prompt.d.ts +32 -0
- package/dist/core/storage.d.ts +15 -0
- package/dist/errors-B3A_zmVE.js +37 -0
- package/dist/errors-CVDNhYqZ.cjs +1 -0
- package/dist/file-DusIs8wR.cjs +1 -0
- package/dist/file-x_kW7BHa.js +49 -0
- package/dist/index.cjs +4 -2
- package/dist/index.d.ts +12 -4
- package/dist/index.js +553 -312
- package/dist/middleware.d.ts +23 -1
- package/dist/nuxt.cjs +1 -1
- package/dist/nuxt.js +11 -7
- package/dist/providers/types.d.ts +5 -0
- package/dist/providers.cjs +9 -7
- package/dist/providers.js +384 -286
- package/dist/server.cjs +6 -0
- package/dist/server.d.ts +24 -0
- package/dist/server.js +166 -0
- package/dist/utils/file.d.ts +21 -0
- package/dist/vue-llm.css +1 -1
- package/package.json +11 -2
package/dist/index.js
CHANGED
|
@@ -1,483 +1,724 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ref as x, watch as V, computed as A, onScopeDispose as L, toValue as N } from "vue";
|
|
2
|
+
import { c as q } from "./file-x_kW7BHa.js";
|
|
3
|
+
import { f as de } from "./file-x_kW7BHa.js";
|
|
4
|
+
import { L as J } from "./errors-B3A_zmVE.js";
|
|
5
|
+
class U {
|
|
6
|
+
constructor(t, e, a) {
|
|
7
|
+
this.messages = t, this.status = e, this.generateId = a;
|
|
5
8
|
}
|
|
6
9
|
messages;
|
|
7
10
|
status;
|
|
8
11
|
generateId;
|
|
9
|
-
async processStream(
|
|
12
|
+
async processStream(t, e, a) {
|
|
10
13
|
this.status.value = "streaming";
|
|
11
|
-
const
|
|
12
|
-
let
|
|
13
|
-
const
|
|
14
|
+
const o = this.getOrCreateAssistantMessage(), s = /* @__PURE__ */ new Map(), l = [];
|
|
15
|
+
let u = "stop", i;
|
|
16
|
+
const v = t.getReader();
|
|
14
17
|
try {
|
|
15
18
|
for (; !e.aborted; ) {
|
|
16
|
-
const { done:
|
|
17
|
-
if (
|
|
18
|
-
if (this.applyChunk(
|
|
19
|
-
const
|
|
20
|
-
let
|
|
19
|
+
const { done: d, value: f } = await v.read();
|
|
20
|
+
if (d) break;
|
|
21
|
+
if (this.applyChunk(o, f, s), f.type === "tool-call-end") {
|
|
22
|
+
const y = s.get(f.toolCallId) ?? "{}";
|
|
23
|
+
let m;
|
|
21
24
|
try {
|
|
22
|
-
|
|
25
|
+
m = JSON.parse(y);
|
|
23
26
|
} catch {
|
|
24
|
-
|
|
27
|
+
m = y;
|
|
25
28
|
}
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
28
|
-
const
|
|
29
|
-
|
|
29
|
+
const h = { toolCallId: f.toolCallId, toolName: this.getToolName(o, f.toolCallId), args: m };
|
|
30
|
+
if (l.push(h), a.onToolCall) {
|
|
31
|
+
const g = this.findToolCallPart(o, f.toolCallId);
|
|
32
|
+
g && (g.state = "running", g.args = m), this.triggerReactivity();
|
|
30
33
|
try {
|
|
31
|
-
const b = await
|
|
32
|
-
b !== void 0 &&
|
|
34
|
+
const b = await a.onToolCall(h);
|
|
35
|
+
b !== void 0 && g && (g.state = "result", g.result = b, this.triggerReactivity());
|
|
33
36
|
} catch (b) {
|
|
34
|
-
|
|
37
|
+
g && (g.state = "error", g.error = b instanceof Error ? b.message : String(b), this.triggerReactivity());
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
|
-
if (
|
|
39
|
-
throw
|
|
41
|
+
if (f.type === "finish" && (u = f.finishReason, i = f.usage), f.type === "error")
|
|
42
|
+
throw f.error;
|
|
40
43
|
this.triggerReactivity();
|
|
41
44
|
}
|
|
42
|
-
} catch (
|
|
45
|
+
} catch (d) {
|
|
43
46
|
if (!e.aborted) {
|
|
44
|
-
const
|
|
45
|
-
throw
|
|
47
|
+
const f = d instanceof Error ? d : new Error(String(d));
|
|
48
|
+
throw a.onError?.(f), f;
|
|
46
49
|
}
|
|
47
50
|
} finally {
|
|
48
|
-
|
|
51
|
+
v.releaseLock();
|
|
49
52
|
}
|
|
50
|
-
return this.finalizeTextParts(
|
|
53
|
+
return this.finalizeTextParts(o), this.triggerReactivity(), a.onFinish?.(o, { finishReason: u, usage: i }), { finishReason: u, usage: i, toolCalls: l };
|
|
51
54
|
}
|
|
52
55
|
getOrCreateAssistantMessage() {
|
|
53
|
-
const
|
|
56
|
+
const t = this.messages.value, e = t[t.length - 1];
|
|
54
57
|
if (e?.role === "assistant") return e;
|
|
55
|
-
const
|
|
58
|
+
const a = {
|
|
56
59
|
id: this.generateId(),
|
|
57
60
|
role: "assistant",
|
|
58
61
|
parts: [],
|
|
59
62
|
createdAt: /* @__PURE__ */ new Date()
|
|
60
63
|
};
|
|
61
|
-
return
|
|
64
|
+
return t.push(a), a;
|
|
62
65
|
}
|
|
63
|
-
applyChunk(
|
|
66
|
+
applyChunk(t, e, a) {
|
|
64
67
|
switch (e.type) {
|
|
65
68
|
case "text-delta": {
|
|
66
|
-
const
|
|
67
|
-
|
|
69
|
+
const o = t.parts[t.parts.length - 1];
|
|
70
|
+
o?.type === "text" && o.state === "streaming" ? o.text += e.text : t.parts.push({ type: "text", text: e.text, state: "streaming" });
|
|
68
71
|
break;
|
|
69
72
|
}
|
|
70
73
|
case "reasoning-delta": {
|
|
71
|
-
const
|
|
72
|
-
|
|
74
|
+
const o = t.parts[t.parts.length - 1];
|
|
75
|
+
o?.type === "reasoning" && o.state === "streaming" ? o.text += e.text : t.parts.push({ type: "reasoning", text: e.text, state: "streaming" });
|
|
73
76
|
break;
|
|
74
77
|
}
|
|
75
78
|
case "tool-call-start":
|
|
76
|
-
|
|
79
|
+
t.parts.push({
|
|
77
80
|
type: "tool-call",
|
|
78
81
|
toolCallId: e.toolCallId,
|
|
79
82
|
toolName: e.toolName,
|
|
80
83
|
args: void 0,
|
|
81
84
|
state: "pending"
|
|
82
|
-
}),
|
|
85
|
+
}), a.set(e.toolCallId, "");
|
|
83
86
|
break;
|
|
84
87
|
case "tool-call-delta":
|
|
85
|
-
|
|
88
|
+
a.set(
|
|
86
89
|
e.toolCallId,
|
|
87
|
-
(
|
|
90
|
+
(a.get(e.toolCallId) ?? "") + e.args
|
|
88
91
|
);
|
|
89
92
|
break;
|
|
90
93
|
}
|
|
91
94
|
}
|
|
92
|
-
finalizeTextParts(
|
|
93
|
-
for (const e of
|
|
95
|
+
finalizeTextParts(t) {
|
|
96
|
+
for (const e of t.parts)
|
|
94
97
|
(e.type === "text" || e.type === "reasoning") && e.state === "streaming" && (e.state = "done");
|
|
95
98
|
}
|
|
96
|
-
findToolCallPart(
|
|
97
|
-
return
|
|
98
|
-
(
|
|
99
|
+
findToolCallPart(t, e) {
|
|
100
|
+
return t.parts.find(
|
|
101
|
+
(a) => a.type === "tool-call" && a.toolCallId === e
|
|
99
102
|
);
|
|
100
103
|
}
|
|
101
|
-
getToolName(
|
|
102
|
-
return this.findToolCallPart(
|
|
104
|
+
getToolName(t, e) {
|
|
105
|
+
return this.findToolCallPart(t, e)?.toolName ?? "";
|
|
103
106
|
}
|
|
104
107
|
triggerReactivity() {
|
|
105
108
|
this.messages.value = [...this.messages.value];
|
|
106
109
|
}
|
|
107
110
|
}
|
|
108
|
-
const
|
|
109
|
-
function
|
|
110
|
-
const
|
|
111
|
+
const j = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
112
|
+
function I(r = 16) {
|
|
113
|
+
const t = crypto.getRandomValues(new Uint8Array(r));
|
|
111
114
|
let e = "";
|
|
112
|
-
for (let
|
|
113
|
-
e +=
|
|
115
|
+
for (let a = 0; a < r; a++)
|
|
116
|
+
e += j[t[a] % j.length];
|
|
114
117
|
return e;
|
|
115
118
|
}
|
|
116
|
-
function
|
|
117
|
-
const
|
|
118
|
-
let
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
119
|
+
function Q(r) {
|
|
120
|
+
const t = r.id ?? I(), e = x(r.initialMessages ?? []), a = x("ready"), o = x(void 0), s = x("");
|
|
121
|
+
let l = null;
|
|
122
|
+
const u = x(!r.storage), i = r.storage, v = (n) => {
|
|
123
|
+
r.onError?.(n instanceof Error ? n : new Error(String(n)));
|
|
124
|
+
};
|
|
125
|
+
if (i) {
|
|
126
|
+
const n = e.value, C = (c) => {
|
|
127
|
+
c?.length && e.value === n && (e.value = c), u.value = !0;
|
|
128
|
+
};
|
|
129
|
+
try {
|
|
130
|
+
const c = i.load(t);
|
|
131
|
+
c instanceof Promise ? c.then(C, (p) => {
|
|
132
|
+
v(p), u.value = !0;
|
|
133
|
+
}) : C(c);
|
|
134
|
+
} catch (c) {
|
|
135
|
+
v(c), u.value = !0;
|
|
136
|
+
}
|
|
137
|
+
V([e, a, u], () => {
|
|
138
|
+
if (!(!u.value || a.value === "submitted" || a.value === "streaming"))
|
|
139
|
+
try {
|
|
140
|
+
const c = e.value.length > 0 ? i.save(t, e.value) : i.remove(t);
|
|
141
|
+
c instanceof Promise && c.catch(v);
|
|
142
|
+
} catch (c) {
|
|
143
|
+
v(c);
|
|
144
|
+
}
|
|
145
|
+
}, { deep: !0 });
|
|
146
|
+
}
|
|
147
|
+
const d = new U(e, a, I), f = () => {
|
|
148
|
+
const n = [], C = [
|
|
149
|
+
N(r.system),
|
|
150
|
+
...e.value.filter((c) => c.role === "system").map((c) => c.parts.filter((p) => p.type === "text").map((p) => p.text).join(""))
|
|
151
|
+
].filter(Boolean);
|
|
152
|
+
C.length > 0 && n.push({ role: "system", content: C.join(`
|
|
153
|
+
|
|
154
|
+
`) });
|
|
155
|
+
for (const c of e.value) {
|
|
156
|
+
if (c.role === "system") continue;
|
|
157
|
+
const E = c.parts.filter((w) => w.type === "text").map((w) => w.text).join(""), S = c.parts.filter((w) => w.type === "tool-call").map((w) => ({ id: w.toolCallId, name: w.toolName, args: w.args }));
|
|
158
|
+
if (c.role === "user") {
|
|
159
|
+
const w = c.parts.filter((O) => O.type === "file");
|
|
160
|
+
if (w.length === 0) {
|
|
161
|
+
n.push({ role: "user", content: E });
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
const D = w.map((O) => ({
|
|
165
|
+
type: "file",
|
|
166
|
+
url: O.url,
|
|
167
|
+
mediaType: O.mediaType,
|
|
168
|
+
filename: O.filename
|
|
169
|
+
}));
|
|
170
|
+
E && D.push({ type: "text", text: E }), n.push({ role: "user", content: D });
|
|
171
|
+
} else if (c.role === "assistant") {
|
|
172
|
+
n.push({
|
|
129
173
|
role: "assistant",
|
|
130
|
-
content:
|
|
131
|
-
toolCalls:
|
|
174
|
+
content: E,
|
|
175
|
+
toolCalls: S.length > 0 ? S : void 0
|
|
132
176
|
});
|
|
133
|
-
for (const
|
|
134
|
-
|
|
177
|
+
for (const w of c.parts)
|
|
178
|
+
w.type !== "tool-call" || w.state !== "result" || n.push({
|
|
135
179
|
role: "tool",
|
|
136
|
-
content: JSON.stringify(
|
|
137
|
-
toolCallId:
|
|
180
|
+
content: JSON.stringify(w.result),
|
|
181
|
+
toolCallId: w.toolCallId
|
|
138
182
|
});
|
|
139
183
|
}
|
|
140
184
|
}
|
|
141
|
-
return
|
|
142
|
-
},
|
|
143
|
-
const
|
|
144
|
-
let
|
|
145
|
-
for (;
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
const { stream: E } = await
|
|
149
|
-
model:
|
|
150
|
-
messages:
|
|
151
|
-
tools:
|
|
152
|
-
signal:
|
|
185
|
+
return n;
|
|
186
|
+
}, y = async (n) => {
|
|
187
|
+
const C = r.maxToolRoundtrips ?? 5;
|
|
188
|
+
let c = 0;
|
|
189
|
+
for (; c < C; ) {
|
|
190
|
+
const p = f();
|
|
191
|
+
r.provider.validateConfig();
|
|
192
|
+
const { stream: E } = await r.provider.chat({
|
|
193
|
+
model: r.model,
|
|
194
|
+
messages: p,
|
|
195
|
+
tools: r.tools,
|
|
196
|
+
signal: n,
|
|
153
197
|
providerOptions: {
|
|
154
|
-
...
|
|
155
|
-
...N(
|
|
198
|
+
...r.providerOptions,
|
|
199
|
+
...N(r.body)
|
|
156
200
|
}
|
|
157
|
-
}),
|
|
158
|
-
onFinish:
|
|
159
|
-
onError:
|
|
160
|
-
onToolCall:
|
|
201
|
+
}), S = await d.processStream(E, n, {
|
|
202
|
+
onFinish: r.onFinish,
|
|
203
|
+
onError: r.onError,
|
|
204
|
+
onToolCall: r.onToolCall
|
|
161
205
|
});
|
|
162
|
-
if (
|
|
206
|
+
if (S.finishReason !== "tool-calls" || S.toolCalls.length === 0)
|
|
163
207
|
break;
|
|
164
|
-
|
|
208
|
+
c++;
|
|
165
209
|
}
|
|
166
|
-
}, m = async (
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
210
|
+
}, m = async (n) => {
|
|
211
|
+
const C = typeof n == "string" ? n : n?.text ?? s.value;
|
|
212
|
+
let c;
|
|
213
|
+
try {
|
|
214
|
+
c = typeof n == "object" ? await q(n.files) : [];
|
|
215
|
+
} catch (S) {
|
|
216
|
+
o.value = S instanceof Error ? S : new Error(String(S)), a.value = "error";
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
if (!C.trim() && c.length === 0) return;
|
|
220
|
+
(typeof n != "object" || n === null || !("text" in n)) && (s.value = "");
|
|
221
|
+
const p = [...c];
|
|
222
|
+
C.trim() && p.push({ type: "text", text: C, state: "done" });
|
|
223
|
+
const E = {
|
|
224
|
+
id: I(),
|
|
172
225
|
role: "user",
|
|
173
|
-
parts:
|
|
226
|
+
parts: p,
|
|
174
227
|
createdAt: /* @__PURE__ */ new Date()
|
|
175
228
|
};
|
|
176
|
-
e.value = [...e.value,
|
|
229
|
+
e.value = [...e.value, E], o.value = void 0, a.value = "submitted", l?.abort(), l = new AbortController();
|
|
177
230
|
try {
|
|
178
|
-
await
|
|
179
|
-
} catch (
|
|
180
|
-
if (
|
|
181
|
-
|
|
231
|
+
await y(l.signal), a.value = "ready";
|
|
232
|
+
} catch (S) {
|
|
233
|
+
if (l.signal.aborted) {
|
|
234
|
+
a.value = "ready";
|
|
182
235
|
return;
|
|
183
236
|
}
|
|
184
|
-
|
|
237
|
+
o.value = S instanceof Error ? S : new Error(String(S)), a.value = "error";
|
|
185
238
|
}
|
|
186
|
-
},
|
|
187
|
-
const
|
|
188
|
-
if (
|
|
189
|
-
e.value =
|
|
239
|
+
}, h = async () => {
|
|
240
|
+
const n = e.value, C = n.reduce((c, p, E) => p.role === "assistant" ? E : c, -1);
|
|
241
|
+
if (C !== -1) {
|
|
242
|
+
e.value = n.slice(0, C), o.value = void 0, a.value = "submitted", l?.abort(), l = new AbortController();
|
|
190
243
|
try {
|
|
191
|
-
await
|
|
192
|
-
} catch (
|
|
193
|
-
if (
|
|
194
|
-
|
|
244
|
+
await y(l.signal), a.value = "ready";
|
|
245
|
+
} catch (c) {
|
|
246
|
+
if (l.signal.aborted) {
|
|
247
|
+
a.value = "ready";
|
|
195
248
|
return;
|
|
196
249
|
}
|
|
197
|
-
|
|
250
|
+
o.value = c instanceof Error ? c : new Error(String(c)), a.value = "error";
|
|
198
251
|
}
|
|
199
252
|
}
|
|
200
|
-
},
|
|
201
|
-
|
|
202
|
-
},
|
|
203
|
-
e.value = typeof
|
|
204
|
-
},
|
|
205
|
-
|
|
206
|
-
},
|
|
207
|
-
for (const
|
|
208
|
-
for (const
|
|
209
|
-
if (
|
|
210
|
-
|
|
253
|
+
}, g = () => {
|
|
254
|
+
l?.abort(), l = null, a.value = "ready";
|
|
255
|
+
}, b = (n) => {
|
|
256
|
+
e.value = typeof n == "function" ? n(e.value) : n;
|
|
257
|
+
}, R = (n) => {
|
|
258
|
+
n?.preventDefault?.(), s.value.trim() && m();
|
|
259
|
+
}, T = A(() => a.value === "submitted" || a.value === "streaming"), P = ({ toolCallId: n, result: C }) => {
|
|
260
|
+
for (const c of e.value)
|
|
261
|
+
for (const p of c.parts)
|
|
262
|
+
if (p.type === "tool-call" && p.toolCallId === n) {
|
|
263
|
+
p.state = "result", p.result = C, e.value = [...e.value];
|
|
211
264
|
return;
|
|
212
265
|
}
|
|
213
|
-
},
|
|
214
|
-
|
|
266
|
+
}, M = () => {
|
|
267
|
+
o.value = void 0, a.value === "error" && (a.value = "ready");
|
|
215
268
|
};
|
|
216
|
-
return
|
|
217
|
-
|
|
269
|
+
return L(() => {
|
|
270
|
+
l?.abort();
|
|
218
271
|
}), {
|
|
219
272
|
messages: e,
|
|
220
|
-
status:
|
|
221
|
-
error:
|
|
222
|
-
id:
|
|
223
|
-
input:
|
|
273
|
+
status: A(() => a.value),
|
|
274
|
+
error: o,
|
|
275
|
+
id: t,
|
|
276
|
+
input: s,
|
|
224
277
|
sendMessage: m,
|
|
225
|
-
regenerate:
|
|
226
|
-
stop:
|
|
227
|
-
setMessages:
|
|
228
|
-
handleSubmit:
|
|
229
|
-
isLoading:
|
|
230
|
-
addToolResult:
|
|
231
|
-
clearError:
|
|
278
|
+
regenerate: h,
|
|
279
|
+
stop: g,
|
|
280
|
+
setMessages: b,
|
|
281
|
+
handleSubmit: R,
|
|
282
|
+
isLoading: T,
|
|
283
|
+
addToolResult: P,
|
|
284
|
+
clearError: M,
|
|
285
|
+
isRestored: A(() => u.value)
|
|
232
286
|
};
|
|
233
287
|
}
|
|
234
|
-
function
|
|
235
|
-
const
|
|
236
|
-
let
|
|
237
|
-
const
|
|
238
|
-
const
|
|
239
|
-
if (!
|
|
240
|
-
|
|
288
|
+
function X(r) {
|
|
289
|
+
const t = r.id ?? I(), e = x(""), a = x("ready"), o = x(void 0), s = x("");
|
|
290
|
+
let l = null;
|
|
291
|
+
const u = async (y) => {
|
|
292
|
+
const m = y ?? s.value;
|
|
293
|
+
if (!m.trim()) return e.value;
|
|
294
|
+
y || (s.value = ""), e.value = "", o.value = void 0, a.value = "submitted", l?.abort(), l = new AbortController();
|
|
241
295
|
try {
|
|
242
|
-
|
|
243
|
-
const
|
|
244
|
-
{ role: "system", content:
|
|
245
|
-
{ role: "user", content:
|
|
246
|
-
] : [{ role: "user", content:
|
|
247
|
-
model:
|
|
248
|
-
messages:
|
|
249
|
-
signal:
|
|
296
|
+
r.provider.validateConfig();
|
|
297
|
+
const h = N(r.system), g = h ? [
|
|
298
|
+
{ role: "system", content: h },
|
|
299
|
+
{ role: "user", content: m }
|
|
300
|
+
] : [{ role: "user", content: m }], { stream: b } = await r.provider.chat({
|
|
301
|
+
model: r.model,
|
|
302
|
+
messages: g,
|
|
303
|
+
signal: l.signal
|
|
250
304
|
});
|
|
251
|
-
|
|
252
|
-
const
|
|
253
|
-
let
|
|
254
|
-
for (; !
|
|
255
|
-
const { done:
|
|
256
|
-
if (
|
|
257
|
-
if (
|
|
258
|
-
e.value +=
|
|
259
|
-
else if (
|
|
260
|
-
|
|
261
|
-
else if (
|
|
262
|
-
throw
|
|
305
|
+
a.value = "streaming";
|
|
306
|
+
const R = b.getReader();
|
|
307
|
+
let T = "stop", P;
|
|
308
|
+
for (; !l.signal.aborted; ) {
|
|
309
|
+
const { done: M, value: n } = await R.read();
|
|
310
|
+
if (M) break;
|
|
311
|
+
if (n.type === "text-delta")
|
|
312
|
+
e.value += n.text;
|
|
313
|
+
else if (n.type === "finish")
|
|
314
|
+
T = n.finishReason, P = n.usage;
|
|
315
|
+
else if (n.type === "error")
|
|
316
|
+
throw n.error;
|
|
263
317
|
}
|
|
264
|
-
return
|
|
265
|
-
} catch (
|
|
266
|
-
if (!
|
|
267
|
-
return
|
|
268
|
-
const
|
|
269
|
-
return
|
|
318
|
+
return R.releaseLock(), a.value = "ready", r.onFinish?.(e.value, { finishReason: T, usage: P }), e.value;
|
|
319
|
+
} catch (h) {
|
|
320
|
+
if (!l || l.signal.aborted)
|
|
321
|
+
return a.value = "ready", e.value;
|
|
322
|
+
const g = h instanceof Error ? h : new Error(String(h));
|
|
323
|
+
return o.value = g, a.value = "error", r.onError?.(g), e.value;
|
|
270
324
|
}
|
|
271
|
-
},
|
|
272
|
-
|
|
273
|
-
},
|
|
274
|
-
|
|
275
|
-
},
|
|
276
|
-
|
|
277
|
-
},
|
|
278
|
-
return
|
|
279
|
-
|
|
325
|
+
}, i = () => {
|
|
326
|
+
l?.abort(), l = null, a.value = "ready";
|
|
327
|
+
}, v = () => {
|
|
328
|
+
o.value = void 0, a.value === "error" && (a.value = "ready");
|
|
329
|
+
}, d = (y) => {
|
|
330
|
+
y?.preventDefault?.(), s.value.trim() && u();
|
|
331
|
+
}, f = A(() => a.value === "submitted" || a.value === "streaming");
|
|
332
|
+
return L(() => {
|
|
333
|
+
l?.abort();
|
|
280
334
|
}), {
|
|
281
335
|
completion: e,
|
|
282
|
-
status:
|
|
283
|
-
error:
|
|
284
|
-
isLoading:
|
|
285
|
-
id:
|
|
286
|
-
input:
|
|
287
|
-
complete:
|
|
288
|
-
stop:
|
|
289
|
-
clearError:
|
|
290
|
-
handleSubmit:
|
|
336
|
+
status: A(() => a.value),
|
|
337
|
+
error: o,
|
|
338
|
+
isLoading: f,
|
|
339
|
+
id: t,
|
|
340
|
+
input: s,
|
|
341
|
+
complete: u,
|
|
342
|
+
stop: i,
|
|
343
|
+
clearError: v,
|
|
344
|
+
handleSubmit: d
|
|
291
345
|
};
|
|
292
346
|
}
|
|
293
|
-
function
|
|
294
|
-
const
|
|
295
|
-
let
|
|
296
|
-
const
|
|
297
|
-
const
|
|
298
|
-
if (!
|
|
299
|
-
|
|
347
|
+
function ee(r) {
|
|
348
|
+
const t = r.id ?? I(), e = x(void 0), a = x(void 0), o = x("ready"), s = x(void 0), l = x("");
|
|
349
|
+
let u = null;
|
|
350
|
+
const i = async (y) => {
|
|
351
|
+
const m = y ?? l.value;
|
|
352
|
+
if (!m.trim()) return e.value;
|
|
353
|
+
y || (l.value = ""), e.value = void 0, a.value = void 0, s.value = void 0, o.value = "submitted", u?.abort(), u = new AbortController();
|
|
300
354
|
try {
|
|
301
|
-
|
|
302
|
-
const
|
|
303
|
-
|
|
355
|
+
r.provider.validateConfig();
|
|
356
|
+
const h = [
|
|
357
|
+
N(r.system) ?? "",
|
|
304
358
|
"Respond with valid JSON matching this schema:",
|
|
305
|
-
JSON.stringify(
|
|
359
|
+
JSON.stringify(r.schema, null, 2),
|
|
306
360
|
"Output ONLY the JSON object, no other text."
|
|
307
361
|
].filter(Boolean).join(`
|
|
308
362
|
|
|
309
|
-
`), { stream:
|
|
310
|
-
model:
|
|
363
|
+
`), { stream: g } = await r.provider.chat({
|
|
364
|
+
model: r.model,
|
|
311
365
|
messages: [
|
|
312
|
-
{ role: "system", content:
|
|
313
|
-
{ role: "user", content:
|
|
366
|
+
{ role: "system", content: h },
|
|
367
|
+
{ role: "user", content: m }
|
|
314
368
|
],
|
|
315
|
-
signal:
|
|
369
|
+
signal: u.signal,
|
|
316
370
|
providerOptions: {
|
|
317
371
|
response_format: { type: "json_object" }
|
|
318
372
|
}
|
|
319
373
|
});
|
|
320
|
-
|
|
321
|
-
const b =
|
|
322
|
-
let
|
|
323
|
-
for (; !
|
|
324
|
-
const { done:
|
|
325
|
-
if (
|
|
326
|
-
if (
|
|
327
|
-
|
|
374
|
+
o.value = "streaming";
|
|
375
|
+
const b = g.getReader();
|
|
376
|
+
let R = "", T = "stop", P;
|
|
377
|
+
for (; !u.signal.aborted; ) {
|
|
378
|
+
const { done: M, value: n } = await b.read();
|
|
379
|
+
if (M) break;
|
|
380
|
+
if (n.type === "text-delta") {
|
|
381
|
+
R += n.text;
|
|
328
382
|
try {
|
|
329
|
-
|
|
383
|
+
a.value = _(R);
|
|
330
384
|
} catch {
|
|
331
385
|
}
|
|
332
|
-
} else if (
|
|
333
|
-
|
|
334
|
-
else if (
|
|
335
|
-
throw
|
|
386
|
+
} else if (n.type === "finish")
|
|
387
|
+
T = n.finishReason, P = n.usage;
|
|
388
|
+
else if (n.type === "error")
|
|
389
|
+
throw n.error;
|
|
336
390
|
}
|
|
337
391
|
b.releaseLock();
|
|
338
392
|
try {
|
|
339
|
-
e.value = JSON.parse(
|
|
393
|
+
e.value = JSON.parse(R), a.value = e.value;
|
|
340
394
|
} catch {
|
|
341
|
-
throw new Error(`Failed to parse JSON response: ${
|
|
395
|
+
throw new Error(`Failed to parse JSON response: ${R.slice(0, 200)}`);
|
|
342
396
|
}
|
|
343
|
-
return
|
|
344
|
-
} catch (
|
|
345
|
-
if (
|
|
346
|
-
return
|
|
347
|
-
const
|
|
348
|
-
|
|
397
|
+
return o.value = "ready", r.onFinish?.(e.value, { finishReason: T, usage: P }), e.value;
|
|
398
|
+
} catch (h) {
|
|
399
|
+
if (u.signal.aborted)
|
|
400
|
+
return o.value = "ready", e.value;
|
|
401
|
+
const g = h instanceof Error ? h : new Error(String(h));
|
|
402
|
+
s.value = g, o.value = "error", r.onError?.(g);
|
|
349
403
|
return;
|
|
350
404
|
}
|
|
351
|
-
},
|
|
352
|
-
|
|
353
|
-
},
|
|
354
|
-
|
|
355
|
-
},
|
|
356
|
-
return
|
|
357
|
-
|
|
405
|
+
}, v = () => {
|
|
406
|
+
u?.abort(), u = null, o.value = "ready";
|
|
407
|
+
}, d = () => {
|
|
408
|
+
s.value = void 0, o.value === "error" && (o.value = "ready");
|
|
409
|
+
}, f = A(() => o.value === "submitted" || o.value === "streaming");
|
|
410
|
+
return L(() => {
|
|
411
|
+
u?.abort();
|
|
358
412
|
}), {
|
|
359
413
|
object: e,
|
|
360
|
-
partialObject:
|
|
361
|
-
status:
|
|
362
|
-
error:
|
|
363
|
-
isLoading:
|
|
364
|
-
id:
|
|
365
|
-
input:
|
|
366
|
-
submit:
|
|
367
|
-
stop:
|
|
368
|
-
clearError:
|
|
414
|
+
partialObject: a,
|
|
415
|
+
status: A(() => o.value),
|
|
416
|
+
error: s,
|
|
417
|
+
isLoading: f,
|
|
418
|
+
id: t,
|
|
419
|
+
input: l,
|
|
420
|
+
submit: i,
|
|
421
|
+
stop: v,
|
|
422
|
+
clearError: d
|
|
369
423
|
};
|
|
370
424
|
}
|
|
371
|
-
function
|
|
372
|
-
let
|
|
373
|
-
if (!
|
|
374
|
-
let e = 0,
|
|
375
|
-
for (let
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
378
|
-
|
|
425
|
+
function _(r) {
|
|
426
|
+
let t = r.trim();
|
|
427
|
+
if (!t.startsWith("{")) return;
|
|
428
|
+
let e = 0, a = !1, o = !1;
|
|
429
|
+
for (let s = 0; s < t.length; s++) {
|
|
430
|
+
const l = t[s];
|
|
431
|
+
if (o) {
|
|
432
|
+
o = !1;
|
|
379
433
|
continue;
|
|
380
434
|
}
|
|
381
|
-
if (
|
|
382
|
-
|
|
435
|
+
if (l === "\\") {
|
|
436
|
+
o = !0;
|
|
383
437
|
continue;
|
|
384
438
|
}
|
|
385
|
-
if (
|
|
386
|
-
|
|
439
|
+
if (l === '"') {
|
|
440
|
+
a = !a;
|
|
387
441
|
continue;
|
|
388
442
|
}
|
|
389
|
-
|
|
443
|
+
a || (l === "{" && e++, l === "}" && e--);
|
|
390
444
|
}
|
|
391
445
|
for (; e > 0; )
|
|
392
|
-
|
|
446
|
+
t += "}", e--;
|
|
393
447
|
try {
|
|
394
|
-
return JSON.parse(
|
|
448
|
+
return JSON.parse(t);
|
|
395
449
|
} catch {
|
|
396
450
|
return;
|
|
397
451
|
}
|
|
398
452
|
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
453
|
+
const F = /(\\)?\{\{\s*([A-Za-z_][\w-]*)\s*\}\}/g;
|
|
454
|
+
function k(r, t = {}) {
|
|
455
|
+
return {
|
|
456
|
+
template: r,
|
|
457
|
+
variables: z(r),
|
|
458
|
+
render(e) {
|
|
459
|
+
return $(r, { ...t.defaults, ...e });
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
function te(r, t = {}) {
|
|
464
|
+
const e = (a) => {
|
|
465
|
+
const o = { ...t.defaults, ...a };
|
|
466
|
+
return r.map((s) => ({ role: s.role, content: $(s.content, o) }));
|
|
467
|
+
};
|
|
468
|
+
return {
|
|
469
|
+
messages: r,
|
|
470
|
+
variables: [...new Set(r.flatMap((a) => z(a.content)))],
|
|
471
|
+
render: e,
|
|
472
|
+
toUIMessages(a) {
|
|
473
|
+
return e(a).map((o) => ({
|
|
474
|
+
id: I(),
|
|
475
|
+
role: o.role,
|
|
476
|
+
parts: [{ type: "text", text: o.content, state: "done" }],
|
|
477
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
478
|
+
}));
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
function $(r, t) {
|
|
483
|
+
return r.replace(F, (e, a, o) => {
|
|
484
|
+
if (a) return e.slice(1);
|
|
485
|
+
const s = t[o];
|
|
486
|
+
if (s == null)
|
|
487
|
+
throw new Error(`[vue-llm] Missing prompt variable "${o}"`);
|
|
488
|
+
return String(s);
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
function z(r) {
|
|
492
|
+
const t = /* @__PURE__ */ new Set();
|
|
493
|
+
for (const [, e, a] of r.matchAll(F))
|
|
494
|
+
e || t.add(a);
|
|
495
|
+
return [...t];
|
|
496
|
+
}
|
|
497
|
+
function re(r, t) {
|
|
498
|
+
const e = typeof r == "string" ? k(r) : r;
|
|
499
|
+
return A(() => e.render(N(t)));
|
|
500
|
+
}
|
|
501
|
+
function ae(r, t) {
|
|
502
|
+
return t.length ? {
|
|
503
|
+
id: r.id,
|
|
504
|
+
supportsStreaming: r.supportsStreaming,
|
|
403
505
|
validateConfig() {
|
|
404
|
-
|
|
506
|
+
r.validateConfig();
|
|
405
507
|
},
|
|
406
508
|
async chat(e) {
|
|
407
|
-
let
|
|
408
|
-
for (const
|
|
409
|
-
|
|
509
|
+
let a = e;
|
|
510
|
+
for (const i of t)
|
|
511
|
+
i.beforeRequest && (a = await i.beforeRequest(a, r));
|
|
512
|
+
const o = t.reduceRight(
|
|
513
|
+
(i, v) => v.wrapChat ? (d) => v.wrapChat(i, d) : i,
|
|
514
|
+
(i) => r.chat(i)
|
|
515
|
+
);
|
|
410
516
|
let s;
|
|
411
517
|
try {
|
|
412
|
-
s = await a
|
|
413
|
-
} catch (
|
|
414
|
-
let
|
|
415
|
-
for (const
|
|
416
|
-
if (
|
|
417
|
-
const
|
|
418
|
-
|
|
518
|
+
s = await o(a);
|
|
519
|
+
} catch (i) {
|
|
520
|
+
let v = i instanceof Error ? i : new Error(String(i));
|
|
521
|
+
for (const d of t)
|
|
522
|
+
if (d.onError) {
|
|
523
|
+
const f = await d.onError(v, a);
|
|
524
|
+
f instanceof Error && (v = f);
|
|
419
525
|
}
|
|
420
|
-
throw
|
|
526
|
+
throw v;
|
|
421
527
|
}
|
|
422
|
-
const
|
|
423
|
-
async transform(
|
|
424
|
-
let
|
|
425
|
-
for (const
|
|
426
|
-
if (!
|
|
427
|
-
|
|
528
|
+
const u = t.some((i) => i.afterStream) ? s.stream.pipeThrough(new TransformStream({
|
|
529
|
+
async transform(i, v) {
|
|
530
|
+
let d = i;
|
|
531
|
+
for (const f of t) {
|
|
532
|
+
if (!d) break;
|
|
533
|
+
f.afterStream && (d = await f.afterStream(d, a));
|
|
428
534
|
}
|
|
429
|
-
|
|
535
|
+
d && v.enqueue(d);
|
|
430
536
|
}
|
|
431
537
|
})) : s.stream;
|
|
432
|
-
for (const
|
|
433
|
-
|
|
434
|
-
return { stream:
|
|
538
|
+
for (const i of t)
|
|
539
|
+
i.onFinish && i.onFinish(a, s);
|
|
540
|
+
return { stream: u, response: s.response };
|
|
435
541
|
}
|
|
436
|
-
} :
|
|
542
|
+
} : r;
|
|
437
543
|
}
|
|
438
|
-
function
|
|
544
|
+
function oe(r = "vue-llm") {
|
|
439
545
|
return {
|
|
440
|
-
beforeRequest(
|
|
441
|
-
return console.log(`[${
|
|
546
|
+
beforeRequest(t) {
|
|
547
|
+
return console.log(`[${r}] → ${t.model}`, t.messages.length, "messages"), t;
|
|
442
548
|
},
|
|
443
|
-
afterStream(
|
|
444
|
-
return
|
|
549
|
+
afterStream(t) {
|
|
550
|
+
return t.type === "finish" && console.log(`[${r}] ← finish:`, t.finishReason, t.usage ?? ""), t;
|
|
445
551
|
},
|
|
446
|
-
onError(
|
|
447
|
-
console.error(`[${
|
|
552
|
+
onError(t) {
|
|
553
|
+
console.error(`[${r}] error:`, t.message);
|
|
554
|
+
}
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
function ne(r = {}, t) {
|
|
558
|
+
const e = typeof r == "number" ? { maxRetries: r, initialDelay: t } : r, a = e.maxRetries ?? 3, o = e.initialDelay ?? 1e3, s = e.maxDelay ?? 3e4, l = e.factor ?? 2, u = e.jitter ?? !0, i = e.shouldRetry ?? W;
|
|
559
|
+
return {
|
|
560
|
+
async wrapChat(v, d) {
|
|
561
|
+
for (let f = 1; ; f++)
|
|
562
|
+
try {
|
|
563
|
+
return await v(d);
|
|
564
|
+
} catch (y) {
|
|
565
|
+
const m = y instanceof Error ? y : new Error(String(y));
|
|
566
|
+
if (f > a || d.signal?.aborted || !i(m, f))
|
|
567
|
+
throw m;
|
|
568
|
+
const h = o * l ** (f - 1), g = m instanceof J ? m.retryAfter : void 0, b = Math.min(
|
|
569
|
+
s,
|
|
570
|
+
g ?? (u ? h * (0.5 + Math.random() * 0.5) : h)
|
|
571
|
+
);
|
|
572
|
+
e.onRetry?.({ error: m, attempt: f, delay: b }), await Y(b, d.signal);
|
|
573
|
+
}
|
|
448
574
|
}
|
|
449
575
|
};
|
|
450
576
|
}
|
|
451
|
-
function
|
|
577
|
+
function W(r) {
|
|
578
|
+
return r.name === "AbortError" ? !1 : r instanceof J ? r.isRetryable : r instanceof TypeError;
|
|
579
|
+
}
|
|
580
|
+
function se(r) {
|
|
581
|
+
const t = r.interval ?? 6e4, e = [];
|
|
582
|
+
let a = 0;
|
|
583
|
+
const o = /* @__PURE__ */ new Set(), s = () => {
|
|
584
|
+
a--;
|
|
585
|
+
for (const u of [...o]) u();
|
|
586
|
+
}, l = async (u) => {
|
|
587
|
+
for (; ; ) {
|
|
588
|
+
u?.throwIfAborted();
|
|
589
|
+
const i = Date.now();
|
|
590
|
+
for (; e.length > 0 && e[0] <= i - t; ) e.shift();
|
|
591
|
+
const v = r.maxRequests !== void 0 && e.length >= r.maxRequests, d = r.maxConcurrent !== void 0 && a >= r.maxConcurrent;
|
|
592
|
+
if (!v && !d) {
|
|
593
|
+
e.push(i), a++;
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
596
|
+
await new Promise((f, y) => {
|
|
597
|
+
const m = () => {
|
|
598
|
+
clearTimeout(g), o.delete(m), u?.removeEventListener("abort", h), f();
|
|
599
|
+
}, h = () => {
|
|
600
|
+
m(), y(u.reason);
|
|
601
|
+
}, g = v ? setTimeout(m, e[0] + t - i) : void 0;
|
|
602
|
+
o.add(m), u?.addEventListener("abort", h, { once: !0 });
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
};
|
|
452
606
|
return {
|
|
453
|
-
async
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
607
|
+
async wrapChat(u, i) {
|
|
608
|
+
await l(i.signal);
|
|
609
|
+
let v;
|
|
610
|
+
try {
|
|
611
|
+
v = await u(i);
|
|
612
|
+
} catch (d) {
|
|
613
|
+
throw s(), d;
|
|
614
|
+
}
|
|
615
|
+
return { ...v, stream: H(v.stream, s) };
|
|
459
616
|
}
|
|
460
617
|
};
|
|
461
618
|
}
|
|
462
|
-
function
|
|
619
|
+
function H(r, t) {
|
|
620
|
+
const e = r.getReader();
|
|
621
|
+
let a = !1;
|
|
622
|
+
const o = () => {
|
|
623
|
+
a || (a = !0, t());
|
|
624
|
+
};
|
|
625
|
+
return new ReadableStream({
|
|
626
|
+
async pull(s) {
|
|
627
|
+
try {
|
|
628
|
+
const { done: l, value: u } = await e.read();
|
|
629
|
+
l ? (o(), s.close()) : s.enqueue(u);
|
|
630
|
+
} catch (l) {
|
|
631
|
+
o(), s.error(l);
|
|
632
|
+
}
|
|
633
|
+
},
|
|
634
|
+
cancel(s) {
|
|
635
|
+
return o(), e.cancel(s);
|
|
636
|
+
}
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
function Y(r, t) {
|
|
640
|
+
return new Promise((e, a) => {
|
|
641
|
+
if (t?.aborted) return a(t.reason);
|
|
642
|
+
const o = setTimeout(() => {
|
|
643
|
+
t?.removeEventListener("abort", s), e();
|
|
644
|
+
}, r), s = () => {
|
|
645
|
+
clearTimeout(o), a(t.reason);
|
|
646
|
+
};
|
|
647
|
+
t?.addEventListener("abort", s, { once: !0 });
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
function le(r) {
|
|
463
651
|
return {
|
|
464
|
-
beforeRequest(
|
|
652
|
+
beforeRequest(t) {
|
|
465
653
|
return {
|
|
466
|
-
...
|
|
654
|
+
...t,
|
|
467
655
|
providerOptions: {
|
|
468
|
-
...
|
|
469
|
-
headers: { ...
|
|
656
|
+
...t.providerOptions,
|
|
657
|
+
headers: { ...t.providerOptions?.headers, ...r }
|
|
470
658
|
}
|
|
471
659
|
};
|
|
472
660
|
}
|
|
473
661
|
};
|
|
474
662
|
}
|
|
663
|
+
function ie(r = {}) {
|
|
664
|
+
const t = r.prefix ?? "vue-llm:chat:", e = () => r.storage ? r.storage : typeof localStorage < "u" ? localStorage : void 0;
|
|
665
|
+
return {
|
|
666
|
+
load(a) {
|
|
667
|
+
const o = e()?.getItem(t + a);
|
|
668
|
+
if (!o) return null;
|
|
669
|
+
try {
|
|
670
|
+
return B(o);
|
|
671
|
+
} catch {
|
|
672
|
+
return null;
|
|
673
|
+
}
|
|
674
|
+
},
|
|
675
|
+
save(a, o) {
|
|
676
|
+
e()?.setItem(t + a, JSON.stringify(o));
|
|
677
|
+
},
|
|
678
|
+
remove(a) {
|
|
679
|
+
e()?.removeItem(t + a);
|
|
680
|
+
}
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
function ce() {
|
|
684
|
+
const r = /* @__PURE__ */ new Map();
|
|
685
|
+
return {
|
|
686
|
+
load(t) {
|
|
687
|
+
const e = r.get(t);
|
|
688
|
+
return e ? B(e) : null;
|
|
689
|
+
},
|
|
690
|
+
save(t, e) {
|
|
691
|
+
r.set(t, JSON.stringify(e));
|
|
692
|
+
},
|
|
693
|
+
remove(t) {
|
|
694
|
+
r.delete(t);
|
|
695
|
+
}
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
function B(r) {
|
|
699
|
+
const t = JSON.parse(r);
|
|
700
|
+
return Array.isArray(t) ? t.map((e) => ({
|
|
701
|
+
...e,
|
|
702
|
+
createdAt: e.createdAt ? new Date(e.createdAt) : void 0
|
|
703
|
+
})) : [];
|
|
704
|
+
}
|
|
475
705
|
export {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
706
|
+
J as LLMAPIError,
|
|
707
|
+
q as convertFilesToParts,
|
|
708
|
+
te as createChatPrompt,
|
|
709
|
+
ce as createMemoryStorage,
|
|
710
|
+
k as createPrompt,
|
|
711
|
+
ie as createWebStorage,
|
|
712
|
+
de as fileToDataURL,
|
|
713
|
+
le as headerMiddleware,
|
|
714
|
+
W as isRetryableError,
|
|
715
|
+
oe as loggingMiddleware,
|
|
716
|
+
se as rateLimitMiddleware,
|
|
717
|
+
$ as renderTemplate,
|
|
718
|
+
ne as retryMiddleware,
|
|
719
|
+
Q as useChat,
|
|
720
|
+
X as useCompletion,
|
|
721
|
+
ee as useObject,
|
|
722
|
+
re as usePrompt,
|
|
723
|
+
ae as wrapProvider
|
|
483
724
|
};
|