@hivegpt/hiveai-angular 0.0.433 → 0.0.434
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/bundles/hivegpt-hiveai-angular.umd.js +25 -17
- package/bundles/hivegpt-hiveai-angular.umd.js.map +1 -1
- package/bundles/hivegpt-hiveai-angular.umd.min.js +1 -1
- package/bundles/hivegpt-hiveai-angular.umd.min.js.map +1 -1
- package/esm2015/lib/components/chat-drawer/chat-drawer.component.js +26 -18
- package/fesm2015/hivegpt-hiveai-angular.js +25 -17
- package/fesm2015/hivegpt-hiveai-angular.js.map +1 -1
- package/lib/components/chat-drawer/chat-drawer.component.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1729,33 +1729,41 @@ class ChatDrawerComponent {
|
|
|
1729
1729
|
else if ((_k = res === null || res === void 0 ? void 0 : res.m) === null || _k === void 0 ? void 0 : _k.OtherFields) {
|
|
1730
1730
|
const otherFields = res.m.OtherFields;
|
|
1731
1731
|
const serializable = otherFields.serializable_to_return;
|
|
1732
|
-
// Session cards:
|
|
1733
|
-
|
|
1732
|
+
// Session cards: get_event_sessions or get_event_sessions_v2 (v2 may send text content; we only show cards when content is JSON with sessions)
|
|
1733
|
+
const isSessionTool = (serializable === null || serializable === void 0 ? void 0 : serializable.tool_name) === 'get_event_sessions' ||
|
|
1734
|
+
(serializable === null || serializable === void 0 ? void 0 : serializable.tool_name) === 'get_event_sessions_v2';
|
|
1735
|
+
if (isSessionTool) {
|
|
1734
1736
|
const contentStr = (_o = (_m = (_l = serializable === null || serializable === void 0 ? void 0 : serializable.tool_result) === null || _l === void 0 ? void 0 : _l.messages) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.content;
|
|
1735
1737
|
const answerText = otherFields.answer != null ? String(otherFields.answer).trim() : '';
|
|
1736
|
-
|
|
1738
|
+
let pushed = false;
|
|
1739
|
+
if (contentStr && typeof contentStr === 'string') {
|
|
1737
1740
|
try {
|
|
1738
1741
|
const parsed = JSON.parse(contentStr);
|
|
1739
1742
|
const sessions = (_p = parsed === null || parsed === void 0 ? void 0 : parsed.sessions) !== null && _p !== void 0 ? _p : [];
|
|
1740
1743
|
const mapped = this.mapSessionsToCardData(sessions);
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1744
|
+
if (mapped.length > 0) {
|
|
1745
|
+
this.chatLog.push({
|
|
1746
|
+
_id: serializable.message_id || `session_cards_${Date.now()}`,
|
|
1747
|
+
type: 'session_cards',
|
|
1748
|
+
message: answerText ? this.processMessageForDisplay(answerText) : '',
|
|
1749
|
+
time: formatNow(this.timezone),
|
|
1750
|
+
sessionCards: mapped,
|
|
1751
|
+
});
|
|
1752
|
+
this.showFeedBackIconsIndex = this.chatLog.length - 1;
|
|
1753
|
+
this.isChatingWithAi = false;
|
|
1754
|
+
this.scrollToBottom();
|
|
1755
|
+
pushed = true;
|
|
1756
|
+
}
|
|
1752
1757
|
}
|
|
1753
1758
|
catch (e) {
|
|
1754
|
-
|
|
1759
|
+
// v2 often sends plain text (e.g. "Found 2 sessions:..."); not JSON - fall through so answer is shown as normal AI message
|
|
1755
1760
|
}
|
|
1756
1761
|
}
|
|
1757
|
-
|
|
1758
|
-
|
|
1762
|
+
if (pushed) {
|
|
1763
|
+
this.cdr.markForCheck();
|
|
1764
|
+
return;
|
|
1765
|
+
}
|
|
1766
|
+
// No session cards pushed (v2 text content or empty): fall through to normal OtherFields handling so answer is displayed
|
|
1759
1767
|
}
|
|
1760
1768
|
// Attendee cards: tool get_event_attendees (same as React Native)
|
|
1761
1769
|
if ((serializable === null || serializable === void 0 ? void 0 : serializable.tool_name) === 'get_event_attendees') {
|