aibox-custom-component-packages 0.0.11 → 0.0.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.
Files changed (76) hide show
  1. package/es/AddOrEditSupplierDialog.mjs +2 -2
  2. package/es/ApplicationTypeTag.mjs +1 -1
  3. package/es/AuthSection.mjs +1 -1
  4. package/es/AvailableRangePreview.mjs +1 -1
  5. package/es/AvailableRangeSetting.mjs +3 -3
  6. package/es/CodeView.mjs +1 -1
  7. package/es/CommonTagsList.mjs +2 -2
  8. package/es/CreateMcpForm.mjs +5 -5
  9. package/es/CustomSidebar.mjs +1 -1
  10. package/es/DocSyncSelect.mjs +1 -1
  11. package/es/FileUploader.mjs +1 -1
  12. package/es/McpFormDialog.mjs +6 -6
  13. package/es/McpParamsSet.mjs +5 -5
  14. package/es/MdEditor.mjs +1 -1
  15. package/es/ParameterTable.mjs +3 -3
  16. package/es/PublishRecord.mjs +1 -1
  17. package/es/SourcePublish.mjs +5 -5
  18. package/es/Table.mjs +1 -1
  19. package/es/assets/CreateMcpForm.css +1 -1
  20. package/es/assets/CustomSidebar.css +1 -1
  21. package/es/assets/McpFormDialog.css +1 -1
  22. package/es/assets/MdEditor.css +1 -1
  23. package/es/assets/SourcePublish.css +1 -1
  24. package/es/chunks/AddOrEditSupplierDialog.BCiXcUBu.js +721 -0
  25. package/es/chunks/AiboxTable.B_Yli5E8.js +635 -0
  26. package/es/chunks/ApplicationTypeTag.BbJwXyVa.js +47 -0
  27. package/es/chunks/AuthSection.CLi8HcIx.js +201 -0
  28. package/es/chunks/AvailableRangePreview.BgeL_bMq.js +194 -0
  29. package/es/chunks/AvailableRangeSetting.CGJxgfPT.js +229 -0
  30. package/es/chunks/CodeView.CWbewuHs.js +148 -0
  31. package/es/chunks/CommonTagsList.CJdBie2N.js +156 -0
  32. package/es/chunks/CommonTagsList.NbXVfvLW.js +156 -0
  33. package/es/chunks/CreateMcpForm.C0HqvD-g.js +308 -0
  34. package/es/chunks/CreateMcpForm.DSE5jyiW.js +308 -0
  35. package/es/chunks/CustomSidebar.BF2dzN8s.js +585 -0
  36. package/es/chunks/DocSyncSelect.DlJXL1lq.js +2290 -0
  37. package/es/chunks/FileUploader.BSIhrd9M.js +216 -0
  38. package/es/chunks/McpFormDialog.CDH31D2Q.js +297 -0
  39. package/es/chunks/McpFormDialog.CgnC1I7i.js +297 -0
  40. package/es/chunks/McpParamsSet.Bx3aRL9j.js +501 -0
  41. package/es/chunks/MdEditor.B9-B9aiy.js +163 -0
  42. package/es/chunks/MdEditor.Bb9S_hso.js +163 -0
  43. package/es/chunks/ParameterTable.CoRz_932.js +2010 -0
  44. package/es/chunks/PublishRecord.C0841sJ-.js +133 -0
  45. package/es/chunks/PublishRecord.C8h1tu3w.js +133 -0
  46. package/es/chunks/SourcePublish.BhLjt18i.js +972 -0
  47. package/es/chunks/SourcePublish.FiswtYfr.js +972 -0
  48. package/es/chunks/SourcePublish.nfXmrVHm.js +972 -0
  49. package/es/chunks/config.CIQoQGOb.js +35 -0
  50. package/es/chunks/config.TaUlPTYL.js +270 -0
  51. package/es/chunks/config.lm2B-n0s.js +270 -0
  52. package/es/chunks/i18n.CIhVBbR3.js +418 -0
  53. package/es/index.mjs +21 -21
  54. package/lib/CommonTagsList.js +1 -1
  55. package/lib/CreateMcpForm.js +1 -1
  56. package/lib/CustomSidebar.js +1 -1
  57. package/lib/McpFormDialog.js +1 -1
  58. package/lib/MdEditor.js +1 -1
  59. package/lib/PublishRecord.js +1 -1
  60. package/lib/SourcePublish.js +1 -1
  61. package/lib/assets/CreateMcpForm.css +1 -1
  62. package/lib/assets/CustomSidebar.css +1 -1
  63. package/lib/assets/McpFormDialog.css +1 -1
  64. package/lib/assets/MdEditor.css +1 -1
  65. package/lib/assets/SourcePublish.css +1 -1
  66. package/lib/chunks/CommonTagsList.QEP4G-Em.js +1 -0
  67. package/lib/chunks/CreateMcpForm.B2o0Ghjg.js +1 -0
  68. package/lib/chunks/CustomSidebar.Bxnggo2-.js +1 -0
  69. package/lib/chunks/McpFormDialog.FwXnBBd2.js +6 -0
  70. package/lib/chunks/MdEditor.Cp24y4DJ.js +1 -0
  71. package/lib/chunks/PublishRecord.BVndvj7F.js +5 -0
  72. package/lib/chunks/SourcePublish.BBsNlnp4.js +1 -0
  73. package/lib/chunks/SourcePublish.CpeV-UOG.js +1 -0
  74. package/lib/chunks/config.B9Di8LtU.js +1 -0
  75. package/lib/index.js +1 -1
  76. package/package.json +7 -6
@@ -0,0 +1,721 @@
1
+ import { t as e } from "./withinstall.dLh4K-0g.js";
2
+ import { m as t } from "./i18n.CIhVBbR3.js";
3
+ import { t as n } from "./request.CfOHcfgX.js";
4
+ import { t as r } from "./FilePreview.De4zHsfc.js";
5
+ import { t as i } from "./_plugin-vue_export-helper.Ct3qlEzt.js";
6
+ import { n as a, t as ee } from "./DialogContainer.DL7aTMDS.js";
7
+ import { t as te } from "./FileUploader.BSIhrd9M.js";
8
+ import { Fragment as o, computed as ne, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, normalizeClass as p, normalizeStyle as m, onMounted as re, openBlock as h, reactive as ie, ref as g, renderList as _, resolveDynamicComponent as v, toDisplayString as y, unref as b, withCtx as x } from "vue";
9
+ import { ElButton as S, ElForm as C, ElFormItem as w, ElIcon as T, ElInput as E, ElMessage as D, ElOption as O, ElSelect as k } from "element-plus";
10
+ import { IconGoto3 as A, IconWarn as j, Workflow as ae } from "color-message-aibox-vue";
11
+ import { useRouter as M } from "vue-router";
12
+ import '../assets/AddOrEditSupplierDialog.css';//#region components/AddOrEditSupplierDialog/apis/model.js
13
+ var oe = () => {
14
+ let { $request: e, $env: t } = n();
15
+ return {
16
+ deleteKey: (n) => e({
17
+ url: `${t.VITE_APP_AIBOX_BASE_URL}/api/v1/model/key/${n}`,
18
+ method: "delete"
19
+ }),
20
+ deleteOwnerModel: (n) => e({
21
+ url: `${t.VITE_APP_AIBOX_BASE_URL}/api/v1/admin/model/${n}`,
22
+ method: "delete"
23
+ }),
24
+ addModel: (n) => e({
25
+ url: `${t.VITE_APP_AIBOX_BASE_URL}/api/v1/admin/model`,
26
+ method: "post",
27
+ data: n
28
+ }),
29
+ updateModel: (n, r) => e({
30
+ url: `${t.VITE_APP_AIBOX_BASE_URL}/api/v1/admin/model/${n}`,
31
+ method: "post",
32
+ data: r
33
+ })
34
+ };
35
+ }, N = [
36
+ {
37
+ label: "COMMON_MODEL_LIBRARY.MODEL_TYPE_LARGE_LANGUAGE_MODEL",
38
+ value: "llm"
39
+ },
40
+ {
41
+ label: "COMMON_MODEL_LIBRARY.MODEL_TYPE_MULTIMODAL_MODEL",
42
+ value: "multimodal"
43
+ },
44
+ {
45
+ label: "COMMON_MODEL_LIBRARY.MODEL_TYPE_EMBEDDING_MODEL",
46
+ value: "embedding"
47
+ },
48
+ {
49
+ label: "COMMON_MODEL_LIBRARY.MODEL_TYPE_RERANK_MODEL",
50
+ value: "rerank"
51
+ }
52
+ ], P = {
53
+ supported: 1,
54
+ not_supported: 0
55
+ }, F = [{
56
+ label: "COMMON_MODEL_LIBRARY.TOOL_CALLING_SUPPORTED",
57
+ value: P.supported
58
+ }, {
59
+ label: "COMMON_MODEL_LIBRARY.TOOL_CALLING_NOT_SUPPORTED",
60
+ value: P.not_supported
61
+ }], I = () => {
62
+ let { $request: e, $env: t } = n();
63
+ return { getSystemReference: (n) => e({
64
+ url: `${t.VITE_APP_AIBOX_BASE_URL}/api/v1/system/reference`,
65
+ method: "get",
66
+ params: n
67
+ }) };
68
+ }, L = () => {
69
+ let { $request: e, $env: t } = n();
70
+ return { deleteKnowledgeBase: (n) => e({
71
+ url: `${t.VITE_APP_AIBOX_BASE_URL}/api/v1/knowledge/${n}`,
72
+ method: "delete"
73
+ }) };
74
+ }, se = () => {
75
+ let { $request: e, $env: t } = n();
76
+ return { del: (n) => e({
77
+ url: `${t.VITE_APP_AIBOX_BASE_URL}/api/v1/workflow/mgr?bnid=${n}`,
78
+ method: "delete"
79
+ }) };
80
+ }, R = () => {
81
+ let { $request: e, $env: t } = n();
82
+ return {
83
+ deleteId: (n) => e({
84
+ url: `${t.VITE_APP_AIBOX_BASE_URL}/api/v1/pluglet/delete/${n}`,
85
+ method: "put"
86
+ }),
87
+ deleteTools: (n) => e({
88
+ url: `${t.VITE_APP_AIBOX_BASE_URL}/api/v1/pluglit/delete/${n}`,
89
+ method: "put"
90
+ })
91
+ };
92
+ }, z = ["onClick"], B = /* @__PURE__ */ i({
93
+ __name: "AiboxTabs",
94
+ props: {
95
+ modelValue: {
96
+ type: [String, Number],
97
+ default: ""
98
+ },
99
+ tabList: {
100
+ type: Array,
101
+ default: () => []
102
+ },
103
+ propsObj: {
104
+ type: Object,
105
+ default: () => ({
106
+ label: "label",
107
+ value: "value"
108
+ })
109
+ },
110
+ styleType: {
111
+ type: [Number, String],
112
+ default: 1
113
+ },
114
+ isShowIcon: {
115
+ type: Boolean,
116
+ default: !1
117
+ }
118
+ },
119
+ emits: ["update:modelValue", "change"],
120
+ setup(e, { emit: t }) {
121
+ let n = t, r = e, i = (e) => {
122
+ n("update:modelValue", e[r.propsObj.value]), n("change", e[r.propsObj.value]);
123
+ };
124
+ return (t, n) => (h(), l("div", { class: p(["ai-box-tabs", `style-${e.styleType}`]) }, [u("ul", null, [(h(!0), l(o, null, _(e.tabList, (t, n) => (h(), l("li", {
125
+ key: t[r.propsObj.value],
126
+ onClick: (e) => i(t),
127
+ class: p(e.modelValue === t[r.propsObj.value] ? "current" : ""),
128
+ style: m(n == e.tabList.length - 1 ? "margin-right: 0;" : "")
129
+ }, [t.icon && e.isShowIcon ? (h(), s(b(T), {
130
+ key: 0,
131
+ size: "18px",
132
+ style: { "margin-right": "4px" },
133
+ color: e.modelValue === t[r.propsObj.value] ? "#262626" : "#7f8387"
134
+ }, {
135
+ default: x(() => [(h(), s(v(t.icon)))]),
136
+ _: 2
137
+ }, 1032, ["color"])) : c("", !0), d(" " + y(t[r.propsObj.label]), 1)], 14, z))), 128))])], 2));
138
+ }
139
+ }, [["__scopeId", "data-v-fd75e38a"]]), V = { class: "delete-title" }, H = { class: "custom-message-box" }, U = {
140
+ class: "custom-message-box__title",
141
+ style: { "line-height": "24px" }
142
+ }, ce = { style: { color: "red" } }, W = {
143
+ key: 0,
144
+ class: "custom-message-box__tip"
145
+ }, le = {
146
+ key: 0,
147
+ class: "delete-tabs"
148
+ }, ue = {
149
+ key: 0,
150
+ class: "resource-list"
151
+ }, de = ["onClick"], fe = { class: "item-title" }, pe = {
152
+ key: 1,
153
+ class: "resource-list"
154
+ }, me = ["onClick"], he = { class: "item-title" }, ge = { class: "dialog-footer" }, G = /* @__PURE__ */ i({
155
+ __name: "DeleteResourceDialog",
156
+ props: {
157
+ title: {
158
+ type: String,
159
+ default: ""
160
+ },
161
+ deleteType: {
162
+ type: String,
163
+ default: ""
164
+ }
165
+ },
166
+ emits: ["success"],
167
+ setup(e, { expose: n, emit: r }) {
168
+ let { getSystemReference: i } = I(), { deleteKnowledgeBase: te } = L(), { del: p } = se(), { deleteId: m, deleteTools: ie } = R(), { deleteKey: v, deleteOwnerModel: C } = oe(), { t: w } = t(), E = M(), { dialogRef: O, showDialog: k, hideDialog: N } = a(), P = e, F = r, z = ne(() => {
169
+ let e = [];
170
+ return J.value.length && e.push({
171
+ label: w("COMPONENTS_OUTER_SPHERE.APPLICATION_REFERENCE", { num: J.value.length }),
172
+ value: "1"
173
+ }), Y.value.length && e.push({
174
+ label: w("COMPONENTS_OUTER_SPHERE.WORKFLOW_REFERENCE", { num: Y.value.length }),
175
+ value: "2"
176
+ }), e;
177
+ }), G = g("1"), K = g(""), q = g(!1), J = g([]), Y = g([]), _e = (e) => {
178
+ let t = {
179
+ model: {
180
+ code: 1,
181
+ desc: w("COMMON_TAG.APPLICATION"),
182
+ deleteFn: async () => await C(K.value)
183
+ },
184
+ knowledge: {
185
+ code: 2,
186
+ desc: w("COMMON_TAG.KNOWLEDGE_BASE"),
187
+ deleteFn: async () => await te(K.value)
188
+ },
189
+ workflow: {
190
+ code: 4,
191
+ desc: w("COMMON_TAG.WORKFLOW"),
192
+ deleteFn: async () => await p(K.value)
193
+ },
194
+ plugin: {
195
+ code: 6,
196
+ desc: w("COMMON_TAG.PLUGIN"),
197
+ deleteFn: async () => await m(K.value)
198
+ },
199
+ pluglit: {
200
+ code: 6,
201
+ desc: w("COMMON_TAG.TOOL"),
202
+ deleteFn: async () => await ie(K.value)
203
+ },
204
+ modelKey: {
205
+ code: 7,
206
+ desc: w("COMMON_TAG.MODEL_KEY"),
207
+ deleteFn: async () => await v(K.value)
208
+ }
209
+ };
210
+ return console.log(e, "value"), t[e];
211
+ }, ve = async () => {
212
+ let e = K.value;
213
+ P.deleteType == "plugin" && (e = ye.value);
214
+ let { code: t, data: n } = await i({
215
+ bnid: e,
216
+ size: 999,
217
+ page: 1,
218
+ "business-type": Z
219
+ });
220
+ t === 0 && ((n.data || []).forEach((e) => {
221
+ e.name == "workflow" && (Y.value = e.data), e.name == "agent" && (J.value = e.data);
222
+ }), J.value.length || (G.value = "2"));
223
+ }, X = g(""), Z = "", Q = null;
224
+ re(() => {
225
+ let e = _e(P.deleteType);
226
+ X.value = e.desc || "", Z = e.code || "", Q = e.deleteFn || null;
227
+ });
228
+ let ye = g(""), be = (e, t = "") => {
229
+ K.value = e, ye.value = t, k(), ve();
230
+ }, xe = async () => {
231
+ if (Q) {
232
+ q.value = !0;
233
+ try {
234
+ let e = await Q();
235
+ e && e.code == 0 ? (D({
236
+ message: w("COMPONENTS_OUTER_SPHERE.DELETE_DATA_SUCCESS", { name: X.value }),
237
+ type: "success"
238
+ }), F("success"), $()) : D({
239
+ message: w("COMPONENTS_OUTER_SPHERE.DELETE_DATA_FAILED", { name: X.value }),
240
+ type: "error"
241
+ });
242
+ } finally {
243
+ q.value = !1;
244
+ }
245
+ }
246
+ }, Se = (e) => {
247
+ E.push({
248
+ name: "AgentDetail",
249
+ params: { bnid: e.skillet }
250
+ });
251
+ }, Ce = (e) => {
252
+ E.push({
253
+ name: "Workflow",
254
+ params: { workflowBnid: e.skillet }
255
+ });
256
+ }, we = () => {}, $ = () => {
257
+ N(), K.value = "", J.value = [], Y.value = [];
258
+ };
259
+ return n({
260
+ showDeleteDialog: be,
261
+ hideDeleteDialog: $
262
+ }), (t, n) => (h(), s(b(ee), {
263
+ title: e.title || b(w)("COMPONENTS_OUTER_SPHERE.CONFIRM_DELETE", { deleteTypeStr: X.value }),
264
+ width: "520px",
265
+ ref_key: "dialogRef",
266
+ ref: O
267
+ }, {
268
+ footer: x(() => [u("div", ge, [f(b(S), {
269
+ onClick: $,
270
+ plain: ""
271
+ }, {
272
+ default: x(() => [d(y(b(w)("COMMON_BUTTON.CANCEL_TEXT")), 1)]),
273
+ _: 1
274
+ }), f(b(S), {
275
+ type: "danger",
276
+ onClick: xe,
277
+ loading: q.value
278
+ }, {
279
+ default: x(() => [d(y(b(w)("COMMON_BUTTON.CONFIRM_AFFIRM")), 1)]),
280
+ _: 1
281
+ }, 8, ["loading"])])]),
282
+ default: x(() => [u("div", V, [f(b(T), { class: "warning-icon" }, {
283
+ default: x(() => [f(b(j))]),
284
+ _: 1
285
+ }), u("div", H, [
286
+ u("div", U, [d(y(b(w)("COMPONENTS_OUTER_SPHERE.HISTORY_REFERENCE", { deleteTypeStr: X.value })) + " ", 1), u("span", ce, y(b(w)("PLUGINLIST.CAUTION")), 1)]),
287
+ J.value.length || Y.value.length ? (h(), l("div", W, y(b(w)("PLUGINLIST.CAUTION_INFO")), 1)) : c("", !0),
288
+ n[1] ||= u("div", null, null, -1)
289
+ ])]), J.value.length || Y.value.length ? (h(), l("div", le, [
290
+ f(B, {
291
+ modelValue: G.value,
292
+ "onUpdate:modelValue": n[0] ||= (e) => G.value = e,
293
+ tabList: z.value,
294
+ onChange: we
295
+ }, null, 8, ["modelValue", "tabList"]),
296
+ G.value == "1" ? (h(), l("div", ue, [(h(!0), l(o, null, _(J.value, (e) => (h(), l("div", {
297
+ class: "resource-item",
298
+ key: e.resource,
299
+ onClick: (t) => Se(e)
300
+ }, [
301
+ n[2] ||= u("div", { class: "flow-name__icon-placeholder" }, null, -1),
302
+ u("div", fe, y(e.name), 1),
303
+ f(b(T), null, {
304
+ default: x(() => [f(b(A))]),
305
+ _: 1
306
+ })
307
+ ], 8, de))), 128))])) : c("", !0),
308
+ G.value == "2" ? (h(), l("div", pe, [(h(!0), l(o, null, _(Y.value, (e) => (h(), l("div", {
309
+ class: "resource-item",
310
+ key: e.resource,
311
+ onClick: (t) => Ce(e)
312
+ }, [
313
+ f(b(T), { size: "32px" }, {
314
+ default: x(() => [f(b(ae))]),
315
+ _: 1
316
+ }),
317
+ u("div", he, y(e.name), 1),
318
+ f(b(T), null, {
319
+ default: x(() => [f(b(A))]),
320
+ _: 1
321
+ })
322
+ ], 8, me))), 128))])) : c("", !0)
323
+ ])) : c("", !0)]),
324
+ _: 1
325
+ }, 8, ["title"]));
326
+ }
327
+ }, [["__scopeId", "data-v-42e471bc"]]), K = { class: "dialog-footer" }, q = e(/* @__PURE__ */ i(/* @__PURE__ */ Object.assign({ name: "AddOrEditSupplierDialog" }, {
328
+ __name: "AddOrEditSupplierDialog",
329
+ props: { showDeleteButton: {
330
+ type: Boolean,
331
+ default: !0
332
+ } },
333
+ emits: ["submit", "success"],
334
+ setup(e, { expose: n, emit: i }) {
335
+ let { t: p } = t(), { addModel: m, updateModel: re } = oe(), A = g(null), j = g([]), ae = g(!1), M = g(!1), { dialogRef: I, hideDialog: L, resetDialog: se } = a(M), R = g(!1), z = g(""), B = ne(() => R.value ? p("COMMON_MODEL_LIBRARY.EDIT_MODEL") : p("COMMON_MODEL_LIBRARY.ADD_MODEL")), V = g(""), H = ie({
336
+ name: "",
337
+ code: "",
338
+ type: "",
339
+ description: "",
340
+ supportFunctionCall: P.supported,
341
+ apiKey: "",
342
+ apiUrl: "",
343
+ bnid: null,
344
+ maxTokens: 2e6,
345
+ contextLength: 2e6,
346
+ icon: "0",
347
+ avatarUrl: ""
348
+ }), U = g(!H.bnid), ce = {
349
+ name: [
350
+ {
351
+ required: !0,
352
+ message: p("COMMON_MODEL_LIBRARY.MODEL_NAME_REQUIRED"),
353
+ trigger: "blur"
354
+ },
355
+ {
356
+ max: 64,
357
+ message: p("COMMON_MODEL_LIBRARY.MODEL_NAME_MAX_LENGTH"),
358
+ trigger: "blur"
359
+ },
360
+ {
361
+ validator: (e, t, n) => {
362
+ t && /\s/.test(t) ? n(Error(p("COMMON_MODEL_LIBRARY.MODEL_NAME_NO_SPACE"))) : n();
363
+ },
364
+ trigger: "blur"
365
+ }
366
+ ],
367
+ code: [
368
+ {
369
+ required: !0,
370
+ message: p("COMMON_MODEL_LIBRARY.MODEL_CODE_REQUIRED"),
371
+ trigger: "blur"
372
+ },
373
+ {
374
+ max: 64,
375
+ message: p("COMMON_MODEL_LIBRARY.MODEL_CODE_MAX_LENGTH"),
376
+ trigger: "blur"
377
+ },
378
+ {
379
+ validator: (e, t, n) => {
380
+ t && /\s/.test(t) ? n(Error(p("COMMON_MODEL_LIBRARY.MODEL_CODE_NO_SPACE"))) : n();
381
+ },
382
+ trigger: "blur"
383
+ }
384
+ ],
385
+ type: [{
386
+ required: !0,
387
+ message: p("COMMON_MODEL_LIBRARY.MODEL_TYPE_PLACEHOLDER"),
388
+ trigger: "change"
389
+ }],
390
+ maxTokens: [{
391
+ required: !0,
392
+ message: p("COMMON_MODEL_LIBRARY.MAX_TOKENS_PLACEHOLDER"),
393
+ trigger: "blur"
394
+ }],
395
+ contextLength: [{
396
+ required: !0,
397
+ message: p("COMMON_MODEL_LIBRARY.CONTEXT_LENGTH_PLACEHOLDER"),
398
+ trigger: "blur"
399
+ }],
400
+ apiKey: [{
401
+ required: !0,
402
+ message: p("COMMON_MODEL_LIBRARY.API_KEY_REQUIRED"),
403
+ trigger: "blur"
404
+ }],
405
+ apiUrl: [{
406
+ required: !0,
407
+ message: p("COMMON_MODEL_LIBRARY.API_URL_REQUIRED"),
408
+ trigger: "blur"
409
+ }, {
410
+ validator: (e, t, n) => {
411
+ if (!t) {
412
+ n();
413
+ return;
414
+ }
415
+ try {
416
+ let e = new URL(t);
417
+ if (e.protocol !== "http:" && e.protocol !== "https:") {
418
+ n(Error(p("COMMON_MODEL_LIBRARY.API_URL_INVALID")));
419
+ return;
420
+ }
421
+ n();
422
+ } catch {
423
+ n(Error(p("COMMON_MODEL_LIBRARY.API_URL_INVALID_DESC")));
424
+ }
425
+ },
426
+ trigger: "blur"
427
+ }]
428
+ }, W = i, le = (e = null) => {
429
+ Object.assign(H, {
430
+ name: "",
431
+ code: "",
432
+ type: "",
433
+ description: "",
434
+ supportFunctionCall: P.supported,
435
+ maxTokens: 2e6,
436
+ contextLength: 2e6,
437
+ supplier: "",
438
+ apiKey: "",
439
+ apiUrl: "",
440
+ bnid: null,
441
+ avatarUrl: "",
442
+ icon: "0"
443
+ }), z.value = e?.rowData?.bnid || "", e?.rowData ? (e.rowData.apiKey || (ae.value = !0), Object.assign(H, e.rowData), V.value = e.rowData.apiUrl || "") : V.value = "", j.value = [], e ? (H.supplier = e.supplier || "", R.value = e.isEditDialog ?? !1, e.rowData?.icon && e.rowData.icon !== "0" && e.rowData?.avatarUrl && (j.value = [{
444
+ bnid: e.rowData.icon,
445
+ url: e.rowData.avatarUrl
446
+ }])) : R.value = !1, I.value?.showDialog();
447
+ }, ue = (e) => {
448
+ e > 2e9 ? H.maxTokens = 2e9 : H.maxTokens = e;
449
+ }, de = (e) => {
450
+ e > 2e9 ? H.contextLength = 2e9 : H.contextLength = e;
451
+ }, fe = async () => {
452
+ A.value && await A.value.validate(async (e) => {
453
+ if (e) {
454
+ M.value = !0;
455
+ let e = 2e9, t = Number(H.maxTokens), n = Number(H.contextLength);
456
+ t = Math.min(t, e), n = Math.min(n, e);
457
+ let r = {
458
+ name: H.name,
459
+ code: H.code,
460
+ icon: H.icon,
461
+ type: H.type,
462
+ description: H.description,
463
+ supportFunctionCall: H.supportFunctionCall,
464
+ maxTokens: t,
465
+ contextLength: n,
466
+ apiKey: H.apiKey,
467
+ apiUrl: H.apiUrl
468
+ };
469
+ R.value ? await me(r) : pe(r);
470
+ } else D.error(p("COMMON_MODEL_LIBRARY.REQUIRED"));
471
+ });
472
+ }, pe = async (e) => {
473
+ try {
474
+ (await m(e)).code === 0 && (D.success(p("COMMON_MODEL_LIBRARY.CREATE_MODEL_SUCCESS")), L(), W("submit"));
475
+ } finally {
476
+ M.value = !1;
477
+ }
478
+ }, me = async (e) => {
479
+ try {
480
+ (await re(z.value, e)).code === 0 && (D.success(p("COMMON_MODEL_LIBRARY.UPDATE_MODEL_SUCCESS")), L(), W("submit"));
481
+ } finally {
482
+ M.value = !1;
483
+ }
484
+ }, he = () => {
485
+ U.value = !U.value;
486
+ }, ge = (e) => {
487
+ H.avatarUrl = e.url, H.icon = e.bnid, j.value = [e];
488
+ }, q = () => {
489
+ H.icon = "0", j.value = [];
490
+ }, J = g(null), Y = () => {
491
+ J.value.showDeleteDialog(z.value);
492
+ }, _e = () => {
493
+ L(), W("success");
494
+ };
495
+ return n({
496
+ showDialog: le,
497
+ hideDialog: L
498
+ }), (t, n) => (h(), l(o, null, [f(b(ee), {
499
+ class: "custom-model-dialog",
500
+ ref_key: "dialogRef",
501
+ ref: I,
502
+ title: B.value,
503
+ width: "520px",
504
+ onClosed: b(se)
505
+ }, {
506
+ footer: x(() => [u("div", K, [
507
+ R.value && e.showDeleteButton ? (h(), s(b(S), {
508
+ key: 0,
509
+ style: { float: "left" },
510
+ type: "danger",
511
+ onClick: Y
512
+ }, {
513
+ default: x(() => [d(y(b(p)("COMMON_BUTTON.DELETE_TEXT")), 1)]),
514
+ _: 1
515
+ })) : c("", !0),
516
+ f(b(S), {
517
+ onClick: b(L),
518
+ plain: ""
519
+ }, {
520
+ default: x(() => [d(y(b(p)("COMMON_BUTTON.CANCEL_TEXT")), 1)]),
521
+ _: 1
522
+ }, 8, ["onClick"]),
523
+ f(b(S), {
524
+ type: "primary",
525
+ loading: M.value,
526
+ onClick: fe,
527
+ disabled: M.value
528
+ }, {
529
+ default: x(() => [d(y(M.value ? b(p)("COMMON_MODEL_LIBRARY.VALIDATION_LOADING") : b(p)("COMMON_BUTTON.CONFIRM_TEXT")), 1)]),
530
+ _: 1
531
+ }, 8, ["loading", "disabled"])
532
+ ])]),
533
+ default: x(() => [f(b(C), {
534
+ ref_key: "formRef",
535
+ ref: A,
536
+ model: H,
537
+ rules: ce,
538
+ "label-width": "auto",
539
+ class: "vertical-form"
540
+ }, {
541
+ default: x(() => [
542
+ f(b(w), {
543
+ label: b(p)("COMMON_MODEL_LIBRARY.MODEL_NAME"),
544
+ prop: "name"
545
+ }, {
546
+ default: x(() => [f(b(E), {
547
+ modelValue: H.name,
548
+ "onUpdate:modelValue": n[0] ||= (e) => H.name = e,
549
+ placeholder: b(p)("COMMON_MODEL_LIBRARY.MODEL_NAME_PLACEHOLDER"),
550
+ maxlength: 64
551
+ }, null, 8, ["modelValue", "placeholder"])]),
552
+ _: 1
553
+ }, 8, ["label"]),
554
+ f(b(w), {
555
+ label: b(p)("COMMON_MODEL_LIBRARY.MODEL_CODE"),
556
+ prop: "code"
557
+ }, {
558
+ default: x(() => [f(b(E), {
559
+ modelValue: H.code,
560
+ "onUpdate:modelValue": n[1] ||= (e) => H.code = e,
561
+ placeholder: b(p)("COMMON_MODEL_LIBRARY.MODEL_CODE_PLACEHOLDER"),
562
+ maxlength: 64
563
+ }, null, 8, ["modelValue", "placeholder"])]),
564
+ _: 1
565
+ }, 8, ["label"]),
566
+ f(b(w), {
567
+ label: b(p)("COMMON_MODEL_LIBRARY.MODEL_AVATAR_URL"),
568
+ prop: "avatarUrl"
569
+ }, {
570
+ default: x(() => [f(b(r), {
571
+ fileList: j.value,
572
+ previewType: "Card",
573
+ onOnRemove: q
574
+ }, {
575
+ CardUploader: x(() => [j.value.length === 0 ? (h(), s(b(te), {
576
+ key: 0,
577
+ limitSize: 5,
578
+ acceptType: ".jpg,.png",
579
+ defaultUploadIcon: "model",
580
+ onOnSuccess: ge,
581
+ businessType: "model"
582
+ })) : c("", !0)]),
583
+ _: 1
584
+ }, 8, ["fileList"])]),
585
+ _: 1
586
+ }, 8, ["label"]),
587
+ f(b(w), {
588
+ label: b(p)("COMMON_MODEL_LIBRARY.MODEL_TYPE"),
589
+ prop: "type"
590
+ }, {
591
+ default: x(() => [f(b(k), {
592
+ modelValue: H.type,
593
+ "onUpdate:modelValue": n[2] ||= (e) => H.type = e,
594
+ placeholder: b(p)("COMMON_MODEL_LIBRARY.MODEL_TYPE_PLACEHOLDER"),
595
+ style: { width: "100%" }
596
+ }, {
597
+ default: x(() => [(h(!0), l(o, null, _(b(N), (e) => (h(), s(b(O), {
598
+ key: e.value,
599
+ label: b(p)(e.label),
600
+ value: e.value
601
+ }, null, 8, ["label", "value"]))), 128))]),
602
+ _: 1
603
+ }, 8, ["modelValue", "placeholder"])]),
604
+ _: 1
605
+ }, 8, ["label"]),
606
+ f(b(w), {
607
+ label: b(p)("COMMON_MODEL_LIBRARY.MODEL_DESCRIPTION"),
608
+ prop: "description"
609
+ }, {
610
+ default: x(() => [f(b(E), {
611
+ modelValue: H.description,
612
+ "onUpdate:modelValue": n[3] ||= (e) => H.description = e,
613
+ type: "textarea",
614
+ placeholder: b(p)("COMMON_MODEL_LIBRARY.MODEL_DESCRIPTION_PLACEHOLDER"),
615
+ maxlength: 200,
616
+ autosize: {
617
+ minRows: 2,
618
+ maxRows: 6
619
+ },
620
+ "show-word-limit": ""
621
+ }, null, 8, ["modelValue", "placeholder"])]),
622
+ _: 1
623
+ }, 8, ["label"]),
624
+ f(b(w), {
625
+ label: b(p)("COMMON_MODEL_LIBRARY.MAX_TOKENS"),
626
+ prop: "maxTokens"
627
+ }, {
628
+ default: x(() => [f(b(E), {
629
+ modelValue: H.maxTokens,
630
+ "onUpdate:modelValue": n[4] ||= (e) => H.maxTokens = e,
631
+ placeholder: b(p)("COMMON_MODEL_LIBRARY.MAX_TOKENS_PLACEHOLDER"),
632
+ onInput: ue
633
+ }, null, 8, ["modelValue", "placeholder"])]),
634
+ _: 1
635
+ }, 8, ["label"]),
636
+ f(b(w), {
637
+ label: b(p)("COMMON_MODEL_LIBRARY.CONTEXT_LENGTH"),
638
+ prop: "contextLength"
639
+ }, {
640
+ default: x(() => [f(b(E), {
641
+ modelValue: H.contextLength,
642
+ "onUpdate:modelValue": n[5] ||= (e) => H.contextLength = e,
643
+ placeholder: b(p)("COMMON_MODEL_LIBRARY.CONTEXT_LENGTH_PLACEHOLDER"),
644
+ onInput: de
645
+ }, null, 8, ["modelValue", "placeholder"])]),
646
+ _: 1
647
+ }, 8, ["label"]),
648
+ f(b(w), {
649
+ label: b(p)("COMMON_MODEL_LIBRARY.TOOL_CALLING"),
650
+ prop: "supportFunctionCall"
651
+ }, {
652
+ default: x(() => [f(b(k), {
653
+ modelValue: H.supportFunctionCall,
654
+ "onUpdate:modelValue": n[6] ||= (e) => H.supportFunctionCall = e,
655
+ placeholder: b(p)("COMMON_MODEL_LIBRARY.TOOL_CALLING_PLACEHOLDER"),
656
+ style: { width: "100%" }
657
+ }, {
658
+ default: x(() => [(h(!0), l(o, null, _(b(F), (e) => (h(), s(b(O), {
659
+ key: e.value,
660
+ label: b(p)(e.label),
661
+ value: e.value
662
+ }, null, 8, ["label", "value"]))), 128))]),
663
+ _: 1
664
+ }, 8, ["modelValue", "placeholder"])]),
665
+ _: 1
666
+ }, 8, ["label"]),
667
+ f(b(w), {
668
+ label: b(p)("COMMON_MODEL_LIBRARY.API_KEY"),
669
+ prop: "apiKey"
670
+ }, {
671
+ default: x(() => [f(b(E), {
672
+ modelValue: H.apiKey,
673
+ "onUpdate:modelValue": n[7] ||= (e) => H.apiKey = e,
674
+ placeholder: b(p)("COMMON_MODEL_LIBRARY.API_KEY_PLACEHOLDER"),
675
+ type: U.value ? "text" : "password"
676
+ }, {
677
+ suffix: x(() => [f(b(T), {
678
+ class: "cursor-pointer",
679
+ onClick: he
680
+ }, {
681
+ default: x(() => [(h(), s(v(U.value ? "IconLook" : "IconHide")))]),
682
+ _: 1
683
+ })]),
684
+ _: 1
685
+ }, 8, [
686
+ "modelValue",
687
+ "placeholder",
688
+ "type"
689
+ ])]),
690
+ _: 1
691
+ }, 8, ["label"]),
692
+ f(b(w), {
693
+ label: b(p)("COMMON_MODEL_LIBRARY.API_URL"),
694
+ prop: "apiUrl"
695
+ }, {
696
+ default: x(() => [f(b(E), {
697
+ modelValue: H.apiUrl,
698
+ "onUpdate:modelValue": n[8] ||= (e) => H.apiUrl = e,
699
+ placeholder: b(p)("COMMON_MODEL_LIBRARY.API_URL_PLACEHOLDER"),
700
+ disabled: !!V.value
701
+ }, null, 8, [
702
+ "modelValue",
703
+ "placeholder",
704
+ "disabled"
705
+ ])]),
706
+ _: 1
707
+ }, 8, ["label"])
708
+ ]),
709
+ _: 1
710
+ }, 8, ["model"])]),
711
+ _: 1
712
+ }, 8, ["title", "onClosed"]), f(G, {
713
+ ref_key: "deleteResourceDialog",
714
+ ref: J,
715
+ deleteType: "model",
716
+ onSuccess: _e
717
+ }, null, 512)], 64));
718
+ }
719
+ }), [["__scopeId", "data-v-e1555473"]]));
720
+ //#endregion
721
+ export { P as a, N as i, G as n, F as o, B as r, q as t };