@epam/ai-dial-chat-hooks 1.1.0-dev.405 → 1.1.0-dev.411
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/conversation.js +1 -1
- package/index.js +1 -1
- package/package.json +22 -22
- package/{useToolsMenu-DLd2C4uO.js → useToolsMenu-zURpMEn1.js} +53 -46
package/conversation.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as e, B as t, C as n, D as r, E as i, F as a, H as o, I as s, L as c, M as l, N as u, O as d, P as f, R as p, S as m, T as h, V as g, _, a as v, b as y, c as b, d as x, f as S, g as C, h as w, i as T, j as E, k as D, l as O, m as k, n as A, o as j, p as M, r as N, s as P, t as F, u as I, v as L, w as R, x as z, y as B, z as V } from "./useToolsMenu-
|
|
1
|
+
import { A as e, B as t, C as n, D as r, E as i, F as a, H as o, I as s, L as c, M as l, N as u, O as d, P as f, R as p, S as m, T as h, V as g, _, a as v, b as y, c as b, d as x, f as S, g as C, h as w, i as T, j as E, k as D, l as O, m as k, n as A, o as j, p as M, r as N, s as P, t as F, u as I, v as L, w as R, x as z, y as B, z as V } from "./useToolsMenu-zURpMEn1.js";
|
|
2
2
|
export { S as attachmentToDto, M as attachmentsToDtos, p as buildAnnouncementSignature, c as createChatStreamApi, E as createDeploymentChangedMessage, x as createMessagePair, z as deriveConversationRowActionState, f as formatAppVersion, j as getConversationPath, C as getConversationSource, i as getLastDeploymentId, r as getLastUserMessageToolConfiguration, u as getModelIdFromConversationId, R as getQuickAppConversationStarters, P as getStarterConversationText, m as getStarterPopulateText, b as getStarterSubmitText, n as getStartersFromSchema, l as getTimeOfDayGreeting, O as hasActiveToolConfig, V as hasAnnouncementContent, t as hasStructuredAnnouncement, T as isAwaitingGenerationResume, I as isMessageChanged, d as isMessageStreaming, D as messageHasStages, e as normalizeResponseFormat, g as sanitizeAnnouncementHtml, o as sanitizeAnnouncementMessageHtml, a as sanitizeFooterHtml, s as shouldWatchForDisplayNameUpdate, h as toOverlayMessages, y as useActiveConversationSync, B as useAsyncConfirmDialog, k as useAttachmentUpload, A as useChatSettingsFormConfig, v as useConversationHandlers, L as useConversationLookupMaps, _ as useConversationPanelItems, N as useConversationStream, w as useImportFilePicker, F as useToolsMenu };
|
package/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { C as at, S as ot, T as st, _ as ct, a as lt, b as ut, c as dt, d as ft,
|
|
|
11
11
|
import { a as At, c as jt, i as Mt, n as Nt, o as Pt, r as Ft, s as It, t as Lt } from "./prompt-resource-Bt1I-8ri.js";
|
|
12
12
|
import { n as Rt, t as zt } from "./formatting-CZyyxBG3.js";
|
|
13
13
|
import { a as Bt, c as Vt, d as Ht, f as Ut, h as Wt, i as Gt, l as Kt, m as qt, n as Jt, o as Yt, p as Xt, r as Zt, s as Qt, t as $t, u as en } from "./skill-manifest-CCX8s4nn.js";
|
|
14
|
-
import { A as tn, B as nn, C as rn, D as an, E as on, F as sn, H as cn, I as ln, L as un, M as dn, N as fn, O as pn, P as mn, R as hn, S as gn, T as _n, V as vn, _ as yn, a as bn, b as xn, c as Sn, d as Cn, f as wn, g as Tn, h as En, i as Dn, j as On, k as kn, l as An, m as jn, n as Mn, o as Nn, p as Pn, r as Fn, s as In, t as Ln, u as Rn, v as zn, w as Bn, x as Vn, y as Hn, z as Un } from "./useToolsMenu-
|
|
14
|
+
import { A as tn, B as nn, C as rn, D as an, E as on, F as sn, H as cn, I as ln, L as un, M as dn, N as fn, O as pn, P as mn, R as hn, S as gn, T as _n, V as vn, _ as yn, a as bn, b as xn, c as Sn, d as Cn, f as wn, g as Tn, h as En, i as Dn, j as On, k as kn, l as An, m as jn, n as Mn, o as Nn, p as Pn, r as Fn, s as In, t as Ln, u as Rn, v as zn, w as Bn, x as Vn, y as Hn, z as Un } from "./useToolsMenu-zURpMEn1.js";
|
|
15
15
|
import { t as Wn } from "./useOAuthCallbackCompletion-CvyTKLER.js";
|
|
16
16
|
import { i as Gn, n as Kn, r as qn, t as Jn } from "./scheduled-task-trigger-D9RZCk52.js";
|
|
17
17
|
import { n as Yn, t as Xn } from "./cron-weekday-B4w29eAC.js";
|
package/package.json
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-chat-hooks",
|
|
3
3
|
"description": "Framework-level React hooks extracted from AI DIAL Chat for building custom chat interfaces",
|
|
4
|
-
"version": "1.1.0-dev.
|
|
4
|
+
"version": "1.1.0-dev.411",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"./index.js",
|
|
9
|
+
"./oauth.js",
|
|
10
|
+
"./file-manager.js",
|
|
11
|
+
"./useToolsetLogin-*.js",
|
|
12
|
+
"./useDialFileManagerTabConfig-*.js"
|
|
13
|
+
],
|
|
7
14
|
"main": "./index.js",
|
|
8
15
|
"module": "./index.js",
|
|
9
16
|
"types": "./index.d.ts",
|
|
@@ -92,21 +99,21 @@
|
|
|
92
99
|
},
|
|
93
100
|
"peerDependencies": {
|
|
94
101
|
"react": "^19.2.6",
|
|
95
|
-
"@epam/ai-dial-attachment-canvas": "1.1.0-dev.
|
|
96
|
-
"@epam/ai-dial-attachment-input": "1.1.0-dev.
|
|
97
|
-
"@epam/ai-dial-catalog": "1.1.0-dev.
|
|
98
|
-
"@epam/ai-dial-chat-api-client": "1.1.0-dev.
|
|
99
|
-
"@epam/ai-dial-chat-overlay": "1.1.0-dev.
|
|
100
|
-
"@epam/ai-dial-chat-shared": "1.1.0-dev.
|
|
101
|
-
"@epam/ai-dial-deployment-creation-form": "1.1.0-dev.
|
|
102
|
-
"@epam/ai-dial-mcp-apps": "1.1.0-dev.
|
|
103
|
-
"@epam/ai-dial-publish-panel": "1.1.0-dev.
|
|
104
|
-
"@epam/ai-dial-quotations": "1.1.0-dev.
|
|
102
|
+
"@epam/ai-dial-attachment-canvas": "1.1.0-dev.411",
|
|
103
|
+
"@epam/ai-dial-attachment-input": "1.1.0-dev.411",
|
|
104
|
+
"@epam/ai-dial-catalog": "1.1.0-dev.411",
|
|
105
|
+
"@epam/ai-dial-chat-api-client": "1.1.0-dev.411",
|
|
106
|
+
"@epam/ai-dial-chat-overlay": "1.1.0-dev.411",
|
|
107
|
+
"@epam/ai-dial-chat-shared": "1.1.0-dev.411",
|
|
108
|
+
"@epam/ai-dial-deployment-creation-form": "1.1.0-dev.411",
|
|
109
|
+
"@epam/ai-dial-mcp-apps": "1.1.0-dev.411",
|
|
110
|
+
"@epam/ai-dial-publish-panel": "1.1.0-dev.411",
|
|
111
|
+
"@epam/ai-dial-quotations": "1.1.0-dev.411",
|
|
105
112
|
"@epam/ai-dial-react-file-manager": "*",
|
|
106
|
-
"@epam/ai-dial-scheduled-tasks": "1.1.0-dev.
|
|
107
|
-
"@epam/ai-dial-share": "1.1.0-dev.
|
|
108
|
-
"@epam/ai-dial-skill-editor": "1.1.0-dev.
|
|
109
|
-
"@epam/ai-dial-source-panel": "1.1.0-dev.
|
|
113
|
+
"@epam/ai-dial-scheduled-tasks": "1.1.0-dev.411",
|
|
114
|
+
"@epam/ai-dial-share": "1.1.0-dev.411",
|
|
115
|
+
"@epam/ai-dial-skill-editor": "1.1.0-dev.411",
|
|
116
|
+
"@epam/ai-dial-source-panel": "1.1.0-dev.411",
|
|
110
117
|
"@epam/ai-dial-ui-kit": "*",
|
|
111
118
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
112
119
|
"@epam/pdf-highlighter-kit": ">=0.0.14"
|
|
@@ -170,13 +177,6 @@
|
|
|
170
177
|
"optional": true
|
|
171
178
|
}
|
|
172
179
|
},
|
|
173
|
-
"sideEffects": [
|
|
174
|
-
"./index.js",
|
|
175
|
-
"./oauth.js",
|
|
176
|
-
"./file-manager.js",
|
|
177
|
-
"./useToolsetLogin-*.js",
|
|
178
|
-
"./useDialFileManagerTabConfig-*.js"
|
|
179
|
-
],
|
|
180
180
|
"repository": {
|
|
181
181
|
"type": "git",
|
|
182
182
|
"url": "git+https://github.com/epam/ai-dial-chat.git",
|
|
@@ -1424,10 +1424,17 @@ var rt = (e) => et.sanitize(e, tt), it = (e) => et.sanitize(e, nt), at = (e) =>
|
|
|
1424
1424
|
pendingStarterContext: C,
|
|
1425
1425
|
setPendingStarterContext: w
|
|
1426
1426
|
};
|
|
1427
|
-
}, qt = (e
|
|
1427
|
+
}, qt = (e) => {
|
|
1428
|
+
let t = e.target?.selector;
|
|
1429
|
+
return t?.type === "html_tag" ? t.id : void 0;
|
|
1430
|
+
}, Jt = (e, t) => {
|
|
1431
|
+
if (e.index != null && t.index != null) return e.index === t.index;
|
|
1432
|
+
let n = qt(e), r = qt(t);
|
|
1433
|
+
return n != null && n === r;
|
|
1434
|
+
}, Yt = (e, t) => {
|
|
1428
1435
|
let n = [...e];
|
|
1429
1436
|
for (let e of t) {
|
|
1430
|
-
let t = n.findIndex((t) => t
|
|
1437
|
+
let t = n.findIndex((t) => Jt(t, e));
|
|
1431
1438
|
if (t >= 0) {
|
|
1432
1439
|
let r = n[t];
|
|
1433
1440
|
n[t] = {
|
|
@@ -1443,7 +1450,7 @@ var rt = (e) => et.sanitize(e, tt), it = (e) => et.sanitize(e, nt), at = (e) =>
|
|
|
1443
1450
|
} else n.push(e);
|
|
1444
1451
|
}
|
|
1445
1452
|
return n;
|
|
1446
|
-
},
|
|
1453
|
+
}, Xt = (e, t) => {
|
|
1447
1454
|
let n = [...e];
|
|
1448
1455
|
for (let e of t) {
|
|
1449
1456
|
let t = e.index == null ? -1 : n.findIndex((t) => t.index === e.index);
|
|
@@ -1455,7 +1462,7 @@ var rt = (e) => et.sanitize(e, tt), it = (e) => et.sanitize(e, nt), at = (e) =>
|
|
|
1455
1462
|
} : n.push(e);
|
|
1456
1463
|
}
|
|
1457
1464
|
return n;
|
|
1458
|
-
},
|
|
1465
|
+
}, Zt = (e, t) => {
|
|
1459
1466
|
let n = [...e];
|
|
1460
1467
|
for (let e of t) {
|
|
1461
1468
|
let t = n.findIndex((t) => t.index === e.index);
|
|
@@ -1464,14 +1471,14 @@ var rt = (e) => et.sanitize(e, tt), it = (e) => et.sanitize(e, nt), at = (e) =>
|
|
|
1464
1471
|
...e,
|
|
1465
1472
|
name: (n[t].name ?? "") + (e.name ?? ""),
|
|
1466
1473
|
content: (n[t].content ?? "") + (e.content ?? "") || void 0,
|
|
1467
|
-
attachments: e.attachments?.length ?
|
|
1474
|
+
attachments: e.attachments?.length ? Xt(n[t].attachments ?? [], e.attachments) : n[t].attachments
|
|
1468
1475
|
} : n.push({
|
|
1469
1476
|
...e,
|
|
1470
1477
|
name: e.name ?? ""
|
|
1471
1478
|
});
|
|
1472
1479
|
}
|
|
1473
1480
|
return n;
|
|
1474
|
-
},
|
|
1481
|
+
}, Qt = (e, t, n) => {
|
|
1475
1482
|
let r = n.choices[0]?.delta, i = r?.content ?? "", a = r?.custom_content?.form_schema, o = r?.custom_content?.attachments, s = r?.custom_content?.stages, c = r?.custom_content?.annotations, l = r?.custom_fields?.annotations, u = r?.custom_content?.state, f = !!i || !!a || !!o?.length || !!s?.length || !!c?.length || !!l?.length || !!u, p = r?.responseId ?? (f ? n.id : void 0);
|
|
1476
1483
|
return !f && !p ? null : e.map((e, n) => {
|
|
1477
1484
|
if (n !== t) return e;
|
|
@@ -1484,33 +1491,33 @@ var rt = (e) => et.sanitize(e, tt), it = (e) => et.sanitize(e, nt), at = (e) =>
|
|
|
1484
1491
|
...e.custom_content,
|
|
1485
1492
|
...a && { form_schema: a },
|
|
1486
1493
|
...o?.length && { attachments: r },
|
|
1487
|
-
...s?.length && { stages:
|
|
1488
|
-
...m.length && { annotations:
|
|
1494
|
+
...s?.length && { stages: Zt(e.custom_content?.stages ?? [], s) },
|
|
1495
|
+
...m.length && { annotations: Yt(e.custom_content?.annotations ?? [], m) },
|
|
1489
1496
|
...u && { state: u }
|
|
1490
1497
|
} }
|
|
1491
1498
|
};
|
|
1492
1499
|
});
|
|
1493
|
-
},
|
|
1500
|
+
}, $t = (e, t) => ({
|
|
1494
1501
|
...e,
|
|
1495
1502
|
...t,
|
|
1496
1503
|
...(e.custom_content || t.custom_content) && { custom_content: {
|
|
1497
1504
|
...e.custom_content,
|
|
1498
1505
|
...t.custom_content
|
|
1499
1506
|
} }
|
|
1500
|
-
}),
|
|
1507
|
+
}), en = (e, t) => {
|
|
1501
1508
|
if (t.messageIndex > e.messages.length) return e;
|
|
1502
1509
|
let n = [...e.messages];
|
|
1503
|
-
return t.messageIndex === n.length ? n.push(t.message) : n[t.messageIndex] =
|
|
1510
|
+
return t.messageIndex === n.length ? n.push(t.message) : n[t.messageIndex] = $t(n[t.messageIndex], t.message), {
|
|
1504
1511
|
...e,
|
|
1505
1512
|
messages: n
|
|
1506
1513
|
};
|
|
1507
|
-
},
|
|
1514
|
+
}, tn = (e) => {
|
|
1508
1515
|
let t = e.custom_content;
|
|
1509
1516
|
return !!e.content || e.responseId != null || !!t?.attachments?.length || !!t?.stages?.length || !!t?.annotations?.length || !!t?.form_schema || t?.state != null;
|
|
1510
|
-
},
|
|
1517
|
+
}, Z = (e) => {
|
|
1511
1518
|
let t = e.messages[e.messages.length - 1];
|
|
1512
|
-
return !!t && t.role === o.Assistant &&
|
|
1513
|
-
},
|
|
1519
|
+
return !!t && t.role === o.Assistant && !tn(t) && t.streamErrorMessage == null && !t.wasStoppedByUser;
|
|
1520
|
+
}, nn = 300 * 1e3, Q = "awaiting-resume", rn = async (e, t) => {
|
|
1514
1521
|
let n = e.getReader(), r = new TextDecoder(), i = "";
|
|
1515
1522
|
try {
|
|
1516
1523
|
for (;;) {
|
|
@@ -1539,8 +1546,8 @@ var rt = (e) => et.sanitize(e, tt), it = (e) => et.sanitize(e, nt), at = (e) =>
|
|
|
1539
1546
|
} catch {} finally {
|
|
1540
1547
|
n.releaseLock();
|
|
1541
1548
|
}
|
|
1542
|
-
},
|
|
1543
|
-
if (!
|
|
1549
|
+
}, an = ({ transport: t, setConversation: n, conversationRef: r, resumingPathsRef: i, bufferedGenerationsRef: a, addStreamingPath: o, removeStreamingPath: s, isPathDisplayed: c }) => (l, u) => {
|
|
1550
|
+
if (!Z(u)) return;
|
|
1544
1551
|
let d = X(l);
|
|
1545
1552
|
if (i.current.has(d)) return;
|
|
1546
1553
|
i.current.add(d), o(d);
|
|
@@ -1554,26 +1561,26 @@ var rt = (e) => et.sanitize(e, tt), it = (e) => et.sanitize(e, nt), at = (e) =>
|
|
|
1554
1561
|
}
|
|
1555
1562
|
}, h = (e) => {
|
|
1556
1563
|
let t = {
|
|
1557
|
-
generationId:
|
|
1564
|
+
generationId: Q,
|
|
1558
1565
|
messageIndex: f,
|
|
1559
1566
|
message: e
|
|
1560
1567
|
};
|
|
1561
1568
|
a.current.set(d, t), c(d) && n((e) => {
|
|
1562
1569
|
if (!e) return e;
|
|
1563
|
-
let n =
|
|
1570
|
+
let n = en(e, t);
|
|
1564
1571
|
return r.current = n, n;
|
|
1565
1572
|
});
|
|
1566
1573
|
}, g = (e) => {
|
|
1567
1574
|
let t = a.current.get(d);
|
|
1568
|
-
if (t?.generationId ===
|
|
1569
|
-
let n =
|
|
1575
|
+
if (t?.generationId === Q) {
|
|
1576
|
+
let n = Qt([t.message], 0, e);
|
|
1570
1577
|
n && (t.message = n[0]);
|
|
1571
1578
|
}
|
|
1572
1579
|
c(d) && n((e) => {
|
|
1573
1580
|
if (!e) return e;
|
|
1574
1581
|
let t = a.current.get(d);
|
|
1575
|
-
if (t?.generationId !==
|
|
1576
|
-
let n =
|
|
1582
|
+
if (t?.generationId !== Q) return e;
|
|
1583
|
+
let n = en(e, t);
|
|
1577
1584
|
return r.current = n, n;
|
|
1578
1585
|
});
|
|
1579
1586
|
}, _ = async () => {
|
|
@@ -1586,13 +1593,13 @@ var rt = (e) => et.sanitize(e, tt), it = (e) => et.sanitize(e, nt), at = (e) =>
|
|
|
1586
1593
|
}
|
|
1587
1594
|
let i = !1, a = window.setTimeout(() => {
|
|
1588
1595
|
n.abort();
|
|
1589
|
-
},
|
|
1596
|
+
}, nn);
|
|
1590
1597
|
try {
|
|
1591
|
-
await
|
|
1598
|
+
await rn(r, async (n) => {
|
|
1592
1599
|
if (n?.action !== "UPDATE") return !1;
|
|
1593
1600
|
try {
|
|
1594
1601
|
let n = await t.getConversation(e(l));
|
|
1595
|
-
if (!
|
|
1602
|
+
if (!Z(n)) return p(n), i = !0, !0;
|
|
1596
1603
|
} catch {}
|
|
1597
1604
|
return !1;
|
|
1598
1605
|
});
|
|
@@ -1608,7 +1615,7 @@ var rt = (e) => et.sanitize(e, tt), it = (e) => et.sanitize(e, nt), at = (e) =>
|
|
|
1608
1615
|
return !1;
|
|
1609
1616
|
}
|
|
1610
1617
|
let r = !1;
|
|
1611
|
-
return await
|
|
1618
|
+
return await rn(n, (e) => {
|
|
1612
1619
|
switch (e.type) {
|
|
1613
1620
|
case "snapshot": return h(e.message), !1;
|
|
1614
1621
|
case "chunk": return g(e.chunk), !1;
|
|
@@ -1621,7 +1628,7 @@ var rt = (e) => et.sanitize(e, tt), it = (e) => et.sanitize(e, nt), at = (e) =>
|
|
|
1621
1628
|
(async () => {
|
|
1622
1629
|
await v() || await _();
|
|
1623
1630
|
})();
|
|
1624
|
-
},
|
|
1631
|
+
}, on = 2e4, sn = ({ conversationId: t, state: { setConversation: n, conversationRef: r }, transport: i, generation: { startGeneration: a, completeGeneration: o }, channel: s, overlay: c, onStopError: u }) => {
|
|
1625
1632
|
let [d, m] = _(() => /* @__PURE__ */ new Set()), [y, b] = _(null), x = g(null), S = g(null), C = g(/* @__PURE__ */ new Set()), w = g(/* @__PURE__ */ new Map()), ee = g(/* @__PURE__ */ new Set()), T = g(t);
|
|
1626
1633
|
p(() => {
|
|
1627
1634
|
T.current = t;
|
|
@@ -1655,15 +1662,15 @@ var rt = (e) => et.sanitize(e, tt), it = (e) => et.sanitize(e, nt), at = (e) =>
|
|
|
1655
1662
|
if (x.current !== g) return;
|
|
1656
1663
|
let t = w.current.get(_);
|
|
1657
1664
|
if (t?.generationId === g) {
|
|
1658
|
-
let n =
|
|
1665
|
+
let n = Qt([t.message], 0, e);
|
|
1659
1666
|
n && (t.message = n[0]);
|
|
1660
1667
|
}
|
|
1661
1668
|
E(_) && n((t) => {
|
|
1662
1669
|
if (!t) return t;
|
|
1663
1670
|
let n = w.current.get(_), i;
|
|
1664
|
-
if (n?.generationId === g) i =
|
|
1671
|
+
if (n?.generationId === g) i = en(t, n);
|
|
1665
1672
|
else {
|
|
1666
|
-
let n =
|
|
1673
|
+
let n = Qt(t.messages, d, e);
|
|
1667
1674
|
if (!n) return t;
|
|
1668
1675
|
i = {
|
|
1669
1676
|
...t,
|
|
@@ -1684,7 +1691,7 @@ var rt = (e) => et.sanitize(e, tt), it = (e) => et.sanitize(e, nt), at = (e) =>
|
|
|
1684
1691
|
let t = w.current.get(_), i = t?.generationId === g ? t : void 0;
|
|
1685
1692
|
i && w.current.delete(_), O(_), x.current === g && (x.current = null, S.current = null, b(null)), o(_, g), s?.notifyGenerationSettled?.(), E(_) && n((t) => {
|
|
1686
1693
|
if (!t) return t;
|
|
1687
|
-
let n = i?.generationId === g ?
|
|
1694
|
+
let n = i?.generationId === g ? en(t, i) : t, a = {
|
|
1688
1695
|
...n,
|
|
1689
1696
|
messages: n.messages.map((t, n) => n === d ? {
|
|
1690
1697
|
...t,
|
|
@@ -1697,7 +1704,7 @@ var rt = (e) => et.sanitize(e, tt), it = (e) => et.sanitize(e, nt), at = (e) =>
|
|
|
1697
1704
|
};
|
|
1698
1705
|
(async () => {
|
|
1699
1706
|
try {
|
|
1700
|
-
let e = s?.channelId ?? await s?.waitForChannel(
|
|
1707
|
+
let e = s?.channelId ?? await s?.waitForChannel(on) ?? void 0;
|
|
1701
1708
|
i.streamCompletion(_, u, f, k, p, g, h, y, e);
|
|
1702
1709
|
} catch (e) {
|
|
1703
1710
|
k.onError(e instanceof Error ? e : Error(String(e)));
|
|
@@ -1717,7 +1724,7 @@ var rt = (e) => et.sanitize(e, tt), it = (e) => et.sanitize(e, nt), at = (e) =>
|
|
|
1717
1724
|
i
|
|
1718
1725
|
]), A = f((e, t) => {
|
|
1719
1726
|
let n = X(e), r = w.current.get(n);
|
|
1720
|
-
return r ?
|
|
1727
|
+
return r ? en(t, r) : t;
|
|
1721
1728
|
}, []), te = f(() => {
|
|
1722
1729
|
let e = x.current;
|
|
1723
1730
|
if (!e || !t) return;
|
|
@@ -1734,7 +1741,7 @@ var rt = (e) => et.sanitize(e, tt), it = (e) => et.sanitize(e, nt), at = (e) =>
|
|
|
1734
1741
|
u,
|
|
1735
1742
|
c,
|
|
1736
1743
|
i
|
|
1737
|
-
]), ne = h(() =>
|
|
1744
|
+
]), ne = h(() => an({
|
|
1738
1745
|
transport: i,
|
|
1739
1746
|
setConversation: n,
|
|
1740
1747
|
conversationRef: r,
|
|
@@ -1757,7 +1764,7 @@ var rt = (e) => et.sanitize(e, tt), it = (e) => et.sanitize(e, nt), at = (e) =>
|
|
|
1757
1764
|
isStreaming: re,
|
|
1758
1765
|
canStopStreaming: j != null && y === j
|
|
1759
1766
|
};
|
|
1760
|
-
},
|
|
1767
|
+
}, cn = {
|
|
1761
1768
|
settings: "Settings",
|
|
1762
1769
|
savedNotification: "Chat settings have been saved",
|
|
1763
1770
|
responseFormatLabel: "Response format",
|
|
@@ -1773,11 +1780,11 @@ var rt = (e) => et.sanitize(e, tt), it = (e) => et.sanitize(e, nt), at = (e) =>
|
|
|
1773
1780
|
temperatureHint: "Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.",
|
|
1774
1781
|
saveLabel: "Apply changes",
|
|
1775
1782
|
saveDisabledTooltip: "Please select a response format"
|
|
1776
|
-
},
|
|
1783
|
+
}, ln = (e) => (e ?? "").toLowerCase().replace(/[^a-z]/g, "") === "plaintext" ? s.PlainText : s.Markdown, un = (e) => {
|
|
1777
1784
|
let t = h(() => ({
|
|
1778
|
-
...
|
|
1785
|
+
...cn,
|
|
1779
1786
|
...e.labels
|
|
1780
|
-
}), [e.labels]), { onSaved: n } = e, r = e.mode === "local" ? e.values.responseFormat :
|
|
1787
|
+
}), [e.labels]), { onSaved: n } = e, r = e.mode === "local" ? e.values.responseFormat : ln(e.conversation.responseFormat), i = e.mode === "local" ? e.values.systemPrompt : e.conversation.prompt ?? "", a = e.mode === "local" ? e.values.temperature : e.conversation.temperature ?? .5, o = f((t) => {
|
|
1781
1788
|
e.mode === "local" ? e.onValuesChange({
|
|
1782
1789
|
responseFormat: t.responseFormat ?? e.values.responseFormat,
|
|
1783
1790
|
systemPrompt: t.systemPrompt ?? e.values.systemPrompt,
|
|
@@ -1825,18 +1832,18 @@ var rt = (e) => et.sanitize(e, tt), it = (e) => et.sanitize(e, nt), at = (e) =>
|
|
|
1825
1832
|
i,
|
|
1826
1833
|
a
|
|
1827
1834
|
]);
|
|
1828
|
-
},
|
|
1835
|
+
}, dn = (e) => e.type === "boolean" || e.type == null && typeof e.default == "boolean", fn = (e) => {
|
|
1829
1836
|
let t = e.replace(/[_-]+/g, " ").trim();
|
|
1830
1837
|
return t.length === 0 ? e : t.charAt(0).toUpperCase() + t.slice(1);
|
|
1831
|
-
},
|
|
1838
|
+
}, pn = (e) => {
|
|
1832
1839
|
let t = e?.properties;
|
|
1833
|
-
return t == null ? [] : Object.entries(t).filter(([, e]) =>
|
|
1840
|
+
return t == null ? [] : Object.entries(t).filter(([, e]) => dn(e)).map(([e, t]) => ({
|
|
1834
1841
|
id: e,
|
|
1835
|
-
label: typeof t.title == "string" && t.title.length > 0 ? t.title :
|
|
1842
|
+
label: typeof t.title == "string" && t.title.length > 0 ? t.title : fn(e),
|
|
1836
1843
|
defaultValue: t.default === !0
|
|
1837
1844
|
}));
|
|
1838
|
-
},
|
|
1839
|
-
let { selectedItemId: t, selectedDeploymentConfiguration: n, toolIcon: r } = e, i = h(() =>
|
|
1845
|
+
}, $ = (e) => {
|
|
1846
|
+
let { selectedItemId: t, selectedDeploymentConfiguration: n, toolIcon: r } = e, i = h(() => pn(n), [n]), a = h(() => Object.fromEntries(i.map(({ id: e, defaultValue: t }) => [e, t])), [i]), [o, s] = _(a), c = JSON.stringify(a), l = g(a);
|
|
1840
1847
|
l.current = a, p(() => {
|
|
1841
1848
|
s(l.current);
|
|
1842
1849
|
}, [t, c]);
|
|
@@ -1872,4 +1879,4 @@ var rt = (e) => et.sanitize(e, tt), it = (e) => et.sanitize(e, nt), at = (e) =>
|
|
|
1872
1879
|
};
|
|
1873
1880
|
};
|
|
1874
1881
|
//#endregion
|
|
1875
|
-
export { Ct as A, ot as B, Ot as C, St as D, bt as E, W as F, it as H, lt as I, U as L, _t as M, gt as N, yt as O, dt as P, st as R, J as S, wt as T, rt as V, Pt as _, Kt as a, At as b, Gt as c, Vt as d, zt as f, Nt as g, Y as h,
|
|
1882
|
+
export { Ct as A, ot as B, Ot as C, St as D, bt as E, W as F, it as H, lt as I, U as L, _t as M, gt as N, yt as O, dt as P, st as R, J as S, wt as T, rt as V, Pt as _, Kt as a, At as b, Gt as c, Vt as d, zt as f, Nt as g, Y as h, Z as i, vt as j, xt as k, Ht as l, Rt as m, un as n, X as o, Bt as p, sn as r, Wt as s, $ as t, Ut as u, Mt as v, Dt as w, kt as x, jt as y, V as z };
|