@myun/gimi-chat 0.0.3 → 0.0.4
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/apis/fetch.d.ts +64 -0
- package/dist/apis/fetch.js +512 -0
- package/dist/apis/useApi.d.ts +57 -0
- package/dist/apis/useApi.js +378 -0
- package/dist/assets/image/Subtract.png +0 -0
- package/dist/assets/image/ai-logo.png +0 -0
- package/dist/assets/image/copyIcon.png +0 -0
- package/dist/assets/image/deepthinkActive.png +0 -0
- package/dist/assets/image/empty-img-dark.png +0 -0
- package/dist/assets/image/empty-img.png +0 -0
- package/dist/assets/image/like_active.png +0 -0
- package/dist/assets/image/love.png +0 -0
- package/dist/assets/image/retry.png +0 -0
- package/dist/assets/image/soundOut.png +0 -0
- package/dist/assets/image/unlike_active.png +0 -0
- package/dist/assets/image/unlove.png +0 -0
- package/dist/assets/lottie/ai-bg.json +1704 -0
- package/dist/assets/lottie/ai-loading.json +192 -0
- package/dist/assets/lottie/ai-output-loading.json +272 -0
- package/dist/assets/lottie/ai-output-normal.json +17694 -0
- package/dist/assets/lottie/ai-output-strengthen.json +17321 -0
- package/dist/assets/lottie/ai-voice-play.json +1 -0
- package/dist/assets/lottie/living.json +705 -0
- package/dist/assets/lottie/myun-living.json +726 -0
- package/dist/assets/lottie/myun-loading.json +530 -0
- package/dist/components/ai-chat-dialogue/index.d.ts +16 -0
- package/dist/components/ai-chat-dialogue/index.js +1056 -0
- package/dist/components/ai-chat-dialogue/index.module.scss +272 -0
- package/dist/components/ai-chat-dialogue/message-parser.d.ts +36 -0
- package/dist/components/ai-chat-dialogue/message-parser.js +52 -0
- package/dist/components/ai-chat-dialogue/tlv.d.ts +7 -0
- package/dist/components/ai-chat-dialogue/tlv.js +32 -0
- package/dist/components/ai-chat-dialogue/volc-voice-call-client.d.ts +47 -0
- package/dist/components/ai-chat-dialogue/volc-voice-call-client.js +246 -0
- package/dist/components/ai-correction/index.d.ts +5 -0
- package/dist/components/ai-correction/index.js +45 -0
- package/dist/components/ai-loading/index.d.ts +3 -0
- package/dist/components/ai-loading/index.js +14 -0
- package/dist/components/ai-loading/index.module.scss +11 -0
- package/dist/components/answer-item/index.d.ts +27 -0
- package/dist/components/answer-item/index.js +194 -0
- package/dist/components/answer-item/index.module.scss +295 -0
- package/dist/components/ask-card/index.d.ts +10 -0
- package/dist/components/ask-card/index.js +76 -0
- package/dist/components/ask-card/index.module.scss +125 -0
- package/dist/components/chat-input/index.d.ts +31 -0
- package/dist/components/chat-input/index.js +433 -0
- package/dist/components/chat-input/index.module.scss +44 -0
- package/dist/components/chat-voice/VoiceCommunication.d.ts +7 -0
- package/dist/components/chat-voice/VoiceCommunication.js +69 -0
- package/dist/components/chat-voice/VoiceRecord.d.ts +7 -0
- package/dist/components/chat-voice/VoiceRecord.js +34 -0
- package/dist/components/conversation-delete/index.d.ts +5 -0
- package/dist/components/conversation-delete/index.js +24 -0
- package/dist/components/dots-loading/index.d.ts +2 -0
- package/dist/components/dots-loading/index.js +11 -0
- package/dist/components/dots-loading/index.module.scss +45 -0
- package/dist/components/empty/index.d.ts +9 -0
- package/dist/components/empty/index.js +32 -0
- package/dist/components/empty/index.module.scss +27 -0
- package/dist/components/excel-components/ExcelCard.d.ts +11 -0
- package/dist/components/excel-components/ExcelCard.js +35 -0
- package/dist/components/excel-components/ExcelExcuting.d.ts +10 -0
- package/dist/components/excel-components/ExcelExcuting.js +263 -0
- package/dist/components/excel-components/ExcelFailCard.d.ts +9 -0
- package/dist/components/excel-components/ExcelFailCard.js +20 -0
- package/dist/components/excel-components/ExcelSuccessCard.d.ts +5 -0
- package/dist/components/excel-components/ExcelSuccessCard.js +50 -0
- package/dist/components/excel-components/index.module.scss +210 -0
- package/dist/components/excel-components/styles.module.scss +186 -0
- package/dist/components/file-card/fileCardSidebar.d.ts +8 -0
- package/dist/components/file-card/fileCardSidebar.js +56 -0
- package/dist/components/file-card/index.d.ts +15 -0
- package/dist/components/file-card/index.js +97 -0
- package/dist/components/file-card/index.module.scss +139 -0
- package/dist/components/file-preview/index.d.ts +3 -0
- package/dist/components/file-preview/index.js +229 -0
- package/dist/components/file-preview/index.module.scss +120 -0
- package/dist/components/file-upload/index.d.ts +16 -0
- package/dist/components/file-upload/index.js +238 -0
- package/dist/components/file-upload/uploadV1.d.ts +16 -0
- package/dist/components/file-upload/uploadV1.js +267 -0
- package/dist/components/gimi-sidebar/index.d.ts +17 -0
- package/dist/components/gimi-sidebar/index.js +41 -0
- package/dist/components/gimi-sidebar/index.module.scss +136 -0
- package/dist/components/header/index.d.ts +5 -0
- package/dist/components/header/index.js +20 -0
- package/dist/components/header/index.module.scss +26 -0
- package/dist/components/iconfont-com/index.d.ts +11 -0
- package/dist/components/iconfont-com/index.js +29 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/knowledge-trace/KnowledgeIconComponent.d.ts +7 -0
- package/dist/components/knowledge-trace/KnowledgeIconComponent.js +101 -0
- package/dist/components/knowledge-trace/classList.d.ts +6 -0
- package/dist/components/knowledge-trace/classList.js +72 -0
- package/dist/components/knowledge-trace/documentList.d.ts +6 -0
- package/dist/components/knowledge-trace/documentList.js +75 -0
- package/dist/components/knowledge-trace/index.d.ts +18 -0
- package/dist/components/knowledge-trace/index.js +155 -0
- package/dist/components/knowledge-trace/index.module.scss +262 -0
- package/dist/components/knowledge-trace/interfaces.d.ts +166 -0
- package/dist/components/knowledge-trace/interfaces.js +1 -0
- package/dist/components/knowledge-trace/videoList.d.ts +6 -0
- package/dist/components/knowledge-trace/videoList.js +91 -0
- package/dist/components/lottie-img/index.d.ts +8 -0
- package/dist/components/lottie-img/index.js +99 -0
- package/dist/components/message-actions/CopyButton.d.ts +7 -0
- package/dist/components/message-actions/CopyButton.js +33 -0
- package/dist/components/message-actions/LikeButton.d.ts +7 -0
- package/dist/components/message-actions/LikeButton.js +34 -0
- package/dist/components/message-actions/RegenerateButton.d.ts +5 -0
- package/dist/components/message-actions/RegenerateButton.js +27 -0
- package/dist/components/message-actions/UnLikeButton.d.ts +7 -0
- package/dist/components/message-actions/UnLikeButton.js +34 -0
- package/dist/components/message-actions/VoicePlay.d.ts +10 -0
- package/dist/components/message-actions/VoicePlay.js +74 -0
- package/dist/components/message-list/index.d.ts +19 -0
- package/dist/components/message-list/index.js +167 -0
- package/dist/components/message-list/index.module.scss +304 -0
- package/dist/components/no-microphone-root/index.d.ts +6 -0
- package/dist/components/no-microphone-root/index.js +36 -0
- package/dist/components/no-microphone-root/index.module.scss +42 -0
- package/dist/components/preset-agent-content/index.d.ts +8 -0
- package/dist/components/preset-agent-content/index.js +24 -0
- package/dist/components/preset-agent-content/index.module.scss +48 -0
- package/dist/components/quoted-content/index.d.ts +0 -0
- package/dist/components/quoted-content/index.js +171 -0
- package/dist/components/quoted-content/index.module.scss +76 -0
- package/dist/components/reasoning-content/index.d.ts +6 -0
- package/dist/components/reasoning-content/index.js +116 -0
- package/dist/components/reasoning-content/index.module.scss +164 -0
- package/dist/components/reference-content/index.d.ts +28 -0
- package/dist/components/reference-content/index.js +125 -0
- package/dist/components/reference-content/index.module.scss +73 -0
- package/dist/components/templates/CommonChat.d.ts +5 -0
- package/dist/components/templates/CommonChat.js +218 -0
- package/dist/components/templates/GimiChatComponent.d.ts +4 -0
- package/dist/components/templates/GimiChatComponent.js +23 -0
- package/dist/components/templates/demo/demo.d.ts +2 -0
- package/dist/components/templates/demo/demo.js +110 -0
- package/dist/components/templates/index.module.scss +119 -0
- package/dist/components/upload-list/index.d.ts +15 -0
- package/dist/components/upload-list/index.js +90 -0
- package/dist/components/upload-list/index.module.scss +119 -0
- package/dist/components/voice-bars/index.d.ts +4 -0
- package/dist/components/voice-bars/index.js +174 -0
- package/dist/components/voice-check-dialog/index.d.ts +8 -0
- package/dist/components/voice-check-dialog/index.js +163 -0
- package/dist/components/voice-check-dialog/index.module.scss +9 -0
- package/dist/components/voice-recording/index.d.ts +9 -0
- package/dist/components/voice-recording/index.js +54 -0
- package/dist/components/voice-recording/index.module.scss +41 -0
- package/dist/components/work-flow-content/demo.d.ts +3 -0
- package/dist/components/work-flow-content/demo.js +11 -0
- package/dist/components/work-flow-content/index.d.ts +6 -0
- package/dist/components/work-flow-content/index.js +55 -0
- package/dist/components/work-flow-content/index.module.scss +23 -0
- package/dist/constants.d.ts +24 -0
- package/dist/constants.js +24 -0
- package/dist/hooks/useChatActions.d.ts +12 -0
- package/dist/hooks/useChatActions.js +207 -0
- package/dist/hooks/useChatHistory.d.ts +8 -0
- package/dist/hooks/useChatHistory.js +225 -0
- package/dist/hooks/useChatMessage.d.ts +49 -0
- package/dist/hooks/useChatMessage.js +87 -0
- package/dist/hooks/useChatRecommend.d.ts +8 -0
- package/dist/hooks/useChatRecommend.js +126 -0
- package/dist/hooks/useChatStream.d.ts +20 -0
- package/dist/hooks/useChatStream.js +244 -0
- package/dist/hooks/useChatUI.d.ts +32 -0
- package/dist/hooks/useChatUI.js +134 -0
- package/dist/hooks/useChatVoice.d.ts +11 -0
- package/dist/hooks/useChatVoice.js +379 -0
- package/dist/hooks/useCommonChatAPI.d.ts +27 -0
- package/dist/hooks/useCommonChatAPI.js +1276 -0
- package/dist/hooks/useFile.d.ts +13 -0
- package/dist/hooks/useFile.js +288 -0
- package/dist/hooks/useKnowledgeService.d.ts +17 -0
- package/dist/hooks/useKnowledgeService.js +210 -0
- package/dist/hooks/useLastEventId.d.ts +8 -0
- package/dist/hooks/useLastEventId.js +66 -0
- package/dist/hooks/useLongPoll.d.ts +3 -0
- package/dist/hooks/useLongPoll.js +111 -0
- package/dist/hooks/useScroll.d.ts +4 -0
- package/dist/hooks/useScroll.js +172 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/interfaces/chatMessage.d.ts +139 -0
- package/dist/interfaces/fileInterface.d.ts +10 -0
- package/dist/interfaces/fileInterface.js +11 -0
- package/dist/interfaces/knowledgeTrace.d.ts +177 -0
- package/dist/store/hooks.d.ts +4 -0
- package/dist/store/hooks.js +3 -0
- package/dist/store/index.d.ts +7 -0
- package/dist/store/index.js +7 -0
- package/dist/store/slices/gimiMenuSlice.d.ts +95 -0
- package/dist/store/slices/gimiMenuSlice.js +251 -0
- package/dist/utils/chatInputUtil.d.ts +19 -0
- package/dist/utils/chatInputUtil.js +45 -0
- package/dist/utils/tools.d.ts +50 -0
- package/dist/utils/tools.js +474 -0
- package/dist/utils/voice-stream.d.ts +119 -0
- package/dist/utils/voice-stream.js +1162 -0
- package/package.json +2 -3
- package/LICENSE +0 -21
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
.quotedContent {
|
|
2
|
+
flex: 1;
|
|
3
|
+
padding-top: 5px;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
height: 100%;
|
|
7
|
+
}
|
|
8
|
+
.searchInput {
|
|
9
|
+
line-height: 29px;
|
|
10
|
+
font-size: 12px;
|
|
11
|
+
padding: 0 10px;
|
|
12
|
+
border-radius: 8px;
|
|
13
|
+
input::placeholder {
|
|
14
|
+
color: #7d91b3;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
.content {
|
|
18
|
+
padding-top: 10px;
|
|
19
|
+
}
|
|
20
|
+
.newtab {
|
|
21
|
+
padding-bottom: 10px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.tabItem {
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
padding: 5px 10px;
|
|
27
|
+
margin: 0 8px;
|
|
28
|
+
border-radius: 8px;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
&:hover {
|
|
31
|
+
background-color: #f7f7fc;
|
|
32
|
+
color: #4086ff;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
.active {
|
|
36
|
+
background-color: #f7f7fc;
|
|
37
|
+
color: #4086ff;
|
|
38
|
+
font-weight: 600;
|
|
39
|
+
}
|
|
40
|
+
.tabContent {
|
|
41
|
+
overflow: auto;
|
|
42
|
+
height: 200px;
|
|
43
|
+
|
|
44
|
+
.table {
|
|
45
|
+
:global(.ant-table-content) {
|
|
46
|
+
font-size: 12px;
|
|
47
|
+
}
|
|
48
|
+
:global(.ant-table-tbody > tr > td) {
|
|
49
|
+
border: none !important;
|
|
50
|
+
}
|
|
51
|
+
.listItem {
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
.img {
|
|
56
|
+
width: 16px;
|
|
57
|
+
margin-right: 5px;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
.tabContent::-webkit-scrollbar {
|
|
63
|
+
width: 6px;
|
|
64
|
+
}
|
|
65
|
+
.tabContent::-webkit-scrollbar-track {
|
|
66
|
+
background: #f1f1f1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.tabContent::-webkit-scrollbar-thumb {
|
|
70
|
+
background: #c1c1c1;
|
|
71
|
+
border-radius: 3px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.tabContent::-webkit-scrollbar-thumb:hover {
|
|
75
|
+
background: #a8a8a8;
|
|
76
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
14
|
+
import React, { useEffect, useRef, useCallback } from 'react';
|
|
15
|
+
import { MMarkdown } from '@myun/gimi-design';
|
|
16
|
+
// import SearchResult from '../search-result';
|
|
17
|
+
import styles from "./index.module.scss";
|
|
18
|
+
import { processString } from "../../utils/tools";
|
|
19
|
+
import LottieImg from "../../components/lottie-img";
|
|
20
|
+
import useScroll from "../../hooks/useScroll";
|
|
21
|
+
import KnowledgeIconGroup from "../knowledge-trace/KnowledgeIconComponent";
|
|
22
|
+
import { IconChevronUp, IconChevronDown } from '@douyinfe/semi-icons';
|
|
23
|
+
import { useAppSelector, useAppDispatch } from "../../store/hooks";
|
|
24
|
+
import { setMessageList } from "../../store/slices/gimiMenuSlice";
|
|
25
|
+
var ResoningContent = function ResoningContent(_ref) {
|
|
26
|
+
var item = _ref.item;
|
|
27
|
+
var containerRef = useRef(null);
|
|
28
|
+
var _useScroll = useScroll(containerRef),
|
|
29
|
+
_useScroll2 = _slicedToArray(_useScroll, 1),
|
|
30
|
+
throttledScrollToBottom = _useScroll2[0];
|
|
31
|
+
var messageList = useAppSelector(function (state) {
|
|
32
|
+
return state.gimiMenu.messageList;
|
|
33
|
+
});
|
|
34
|
+
var messageListRef = useRef(messageList);
|
|
35
|
+
messageListRef.current = messageList;
|
|
36
|
+
var dispatch = useAppDispatch();
|
|
37
|
+
var updataChatList = React.useCallback(function (id, expand) {
|
|
38
|
+
var _messageListRef$curre;
|
|
39
|
+
var newMessageList = (_messageListRef$curre = messageListRef.current) === null || _messageListRef$curre === void 0 ? void 0 : _messageListRef$curre.map(function (item) {
|
|
40
|
+
if (item.id === id) {
|
|
41
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
42
|
+
expand: expand
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return item;
|
|
46
|
+
});
|
|
47
|
+
dispatch(setMessageList({
|
|
48
|
+
messageList: newMessageList
|
|
49
|
+
}));
|
|
50
|
+
}, [messageList, dispatch]);
|
|
51
|
+
var handleClickExpand = useCallback(function () {
|
|
52
|
+
updataChatList(item.id, !item.expand);
|
|
53
|
+
}, [item.id, item.expand]);
|
|
54
|
+
useEffect(function () {
|
|
55
|
+
throttledScrollToBottom();
|
|
56
|
+
}, [item.reasoningContent]);
|
|
57
|
+
useEffect(function () {
|
|
58
|
+
if (item.reasoningStatus === 2) {
|
|
59
|
+
updataChatList(item.id, false);
|
|
60
|
+
}
|
|
61
|
+
}, [item.reasoningStatus]);
|
|
62
|
+
var renderStatusText = function renderStatusText() {
|
|
63
|
+
switch (item.reasoningStatus) {
|
|
64
|
+
case 1:
|
|
65
|
+
return '推理中';
|
|
66
|
+
case 2:
|
|
67
|
+
return '推理完成';
|
|
68
|
+
default:
|
|
69
|
+
return '推理已停止';
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
// item.expand ? styles.expand : ''
|
|
73
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
74
|
+
className: styles.container
|
|
75
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
76
|
+
className: styles.header,
|
|
77
|
+
onClick: handleClickExpand
|
|
78
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
className: styles.title
|
|
80
|
+
}, "GIMI", renderStatusText()), item.expand ? /*#__PURE__*/React.createElement(IconChevronUp, null) : /*#__PURE__*/React.createElement(IconChevronDown, null)), item.expand ? /*#__PURE__*/React.createElement("div", {
|
|
81
|
+
className: styles.deeping,
|
|
82
|
+
ref: containerRef,
|
|
83
|
+
style: item.reasoningStatus === 1 ? {
|
|
84
|
+
maxHeight: 240
|
|
85
|
+
} : {}
|
|
86
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
87
|
+
className: styles.thinkQuery
|
|
88
|
+
}, item.query && /*#__PURE__*/React.createElement("div", {
|
|
89
|
+
className: styles.label,
|
|
90
|
+
style: {
|
|
91
|
+
marginTop: 0
|
|
92
|
+
}
|
|
93
|
+
}, "\u5F00\u59CB\u5206\u6790\u95EE\u9898"), item.query && /*#__PURE__*/React.createElement("div", {
|
|
94
|
+
className: styles.queryTitle
|
|
95
|
+
}, item.query)), /*#__PURE__*/React.createElement("div", {
|
|
96
|
+
className: styles.deepThink
|
|
97
|
+
}, item.query && /*#__PURE__*/React.createElement("div", {
|
|
98
|
+
className: styles.label
|
|
99
|
+
}, "\u8FDB\u884C\u6DF1\u5EA6\u601D\u8003"), item.reasoningContent && /*#__PURE__*/React.createElement("div", {
|
|
100
|
+
className: styles.deepThink_content
|
|
101
|
+
}, /*#__PURE__*/React.createElement(MMarkdown, {
|
|
102
|
+
content: processString(item.reasoningContent),
|
|
103
|
+
isDeep: true,
|
|
104
|
+
customRender: [{
|
|
105
|
+
type: 'knowledge',
|
|
106
|
+
component: KnowledgeIconGroup
|
|
107
|
+
}],
|
|
108
|
+
showLoading: item.reasoningLoading
|
|
109
|
+
}))), item.msgLoading && /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
className: styles.answerLoading
|
|
111
|
+
}, /*#__PURE__*/React.createElement(LottieImg, {
|
|
112
|
+
name: "aiLoading",
|
|
113
|
+
size: [20, 40]
|
|
114
|
+
}))) : null);
|
|
115
|
+
};
|
|
116
|
+
export default ResoningContent;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
max-width: clamp(380px, 60vw, 800px);
|
|
3
|
+
padding: 0 20px;
|
|
4
|
+
border-left: 2px solid #d9dce5;
|
|
5
|
+
margin-bottom: 16px;
|
|
6
|
+
user-select: none;
|
|
7
|
+
.header {
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 22px;
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
// justify-content: space-between;
|
|
14
|
+
.title {
|
|
15
|
+
height: 16px;
|
|
16
|
+
font-family: PingFangSC, PingFang SC;
|
|
17
|
+
font-weight: 600;
|
|
18
|
+
font-size: 16px;
|
|
19
|
+
color: #2e394c;
|
|
20
|
+
line-height: 16px;
|
|
21
|
+
text-align: left;
|
|
22
|
+
font-style: normal;
|
|
23
|
+
display: flex;
|
|
24
|
+
margin-right: 4px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
.thinkQuery {
|
|
28
|
+
width: 100%;
|
|
29
|
+
.queryTitle {
|
|
30
|
+
margin-top: 8px;
|
|
31
|
+
min-height: 26px;
|
|
32
|
+
font-family: PingFangSC, PingFang SC;
|
|
33
|
+
font-weight: 400;
|
|
34
|
+
font-size: 14px;
|
|
35
|
+
color: #7d91b3;
|
|
36
|
+
line-height: 26px;
|
|
37
|
+
text-align: left;
|
|
38
|
+
font-style: normal;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
.deepThink {
|
|
42
|
+
width: 100%;
|
|
43
|
+
.deepThink_content {
|
|
44
|
+
margin-top: 4px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
.deeping {
|
|
48
|
+
margin-top: 8px;
|
|
49
|
+
overflow-y: scroll;
|
|
50
|
+
}
|
|
51
|
+
.deepThinkPack {
|
|
52
|
+
width: 100%;
|
|
53
|
+
position: relative;
|
|
54
|
+
.deepThink_content_pack {
|
|
55
|
+
margin-top: 13px;
|
|
56
|
+
display: flex;
|
|
57
|
+
}
|
|
58
|
+
.text_shanow_up {
|
|
59
|
+
z-index: 2;
|
|
60
|
+
pointer-events: none;
|
|
61
|
+
background: #ffffff;
|
|
62
|
+
filter: blur(10px);
|
|
63
|
+
width: 97%;
|
|
64
|
+
height: 25px;
|
|
65
|
+
position: absolute;
|
|
66
|
+
top: -6px;
|
|
67
|
+
}
|
|
68
|
+
.text_shanow_down {
|
|
69
|
+
z-index: 2;
|
|
70
|
+
pointer-events: none;
|
|
71
|
+
background: #ffffff;
|
|
72
|
+
filter: blur(10px);
|
|
73
|
+
width: 97%;
|
|
74
|
+
height: 25px;
|
|
75
|
+
position: absolute;
|
|
76
|
+
bottom: 1px;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
.deeping::-webkit-scrollbar-track {
|
|
81
|
+
background-color: transparent;
|
|
82
|
+
}
|
|
83
|
+
.deeping::-webkit-scrollbar {
|
|
84
|
+
width: 6px;
|
|
85
|
+
}
|
|
86
|
+
// 滚动条的滑块
|
|
87
|
+
.deeping::-webkit-scrollbar-thumb {
|
|
88
|
+
border-radius: 8px;
|
|
89
|
+
background: #d9d9d9;
|
|
90
|
+
opacity: 0;
|
|
91
|
+
display: none;
|
|
92
|
+
transition: opacity 0.3s ease;
|
|
93
|
+
}
|
|
94
|
+
.deeping::-webkit-scrollbar-thumb:hover {
|
|
95
|
+
border-radius: 8px;
|
|
96
|
+
background: rgba(0, 0, 0, 0.15);
|
|
97
|
+
}
|
|
98
|
+
.expand {
|
|
99
|
+
padding-bottom: 20px;
|
|
100
|
+
}
|
|
101
|
+
.label {
|
|
102
|
+
margin-top: 20px;
|
|
103
|
+
height: 26px;
|
|
104
|
+
font-family: PingFangSC, PingFang SC;
|
|
105
|
+
font-weight: 400;
|
|
106
|
+
font-size: 14px;
|
|
107
|
+
color: #2e394c;
|
|
108
|
+
line-height: 26px;
|
|
109
|
+
text-align: left;
|
|
110
|
+
font-style: normal;
|
|
111
|
+
}
|
|
112
|
+
.icon {
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
justify-self: center;
|
|
116
|
+
margin-right: 4px;
|
|
117
|
+
}
|
|
118
|
+
.answerLoading {
|
|
119
|
+
width: 40px;
|
|
120
|
+
margin-left: -10px;
|
|
121
|
+
margin-bottom: 20px;
|
|
122
|
+
margin: 10px 0 10px -10px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.loadingContainer {
|
|
126
|
+
display: flex;
|
|
127
|
+
justify-content: center;
|
|
128
|
+
align-items: center;
|
|
129
|
+
margin-left: 8px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.loadingDots {
|
|
133
|
+
display: flex;
|
|
134
|
+
gap: 3px; /* 减小间距 */
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.dot {
|
|
138
|
+
width: 8px; /* 减小大小 */
|
|
139
|
+
height: 8px; /* 减小大小 */
|
|
140
|
+
background-color: #4086ff; /* 换成antd主题浅蓝色 */
|
|
141
|
+
border-radius: 50%;
|
|
142
|
+
will-change: transform; /* 告诉浏览器提前优化动画 */
|
|
143
|
+
animation: bounce 0.8s infinite ease-in-out both; /* 减小动画变化幅度 */
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.dot:nth-child(1) {
|
|
147
|
+
animation-delay: -0.24s; /* 调整延迟 */
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.dot:nth-child(2) {
|
|
151
|
+
animation-delay: -0.12s; /* 调整延迟 */
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@keyframes bounce {
|
|
155
|
+
0%,
|
|
156
|
+
85%,
|
|
157
|
+
100% {
|
|
158
|
+
/* 减小动画变化幅度 */
|
|
159
|
+
transform: scale(0.6);
|
|
160
|
+
}
|
|
161
|
+
40% {
|
|
162
|
+
transform: scale(1);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IQuoteTeachModel {
|
|
3
|
+
teachModelId: number;
|
|
4
|
+
teachModelName: string;
|
|
5
|
+
type?: string;
|
|
6
|
+
duration: number;
|
|
7
|
+
canCancel?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface IQuoteProduct {
|
|
10
|
+
productId: number;
|
|
11
|
+
productName: string;
|
|
12
|
+
canCancel?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const TeachModelReferenceContent: React.FC<{
|
|
15
|
+
item: IQuoteTeachModel;
|
|
16
|
+
showDuration: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const ProductReferenceContent: React.FC<{
|
|
19
|
+
item: IQuoteProduct;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const ReferencesEdit: React.FC<{
|
|
22
|
+
quoteTeachModelList: IQuoteTeachModel[];
|
|
23
|
+
quoteProductList: IQuoteProduct[];
|
|
24
|
+
}>;
|
|
25
|
+
export declare const References: React.FC<{
|
|
26
|
+
quoteTeachModelList: IQuoteTeachModel[];
|
|
27
|
+
quoteProductList: IQuoteProduct[];
|
|
28
|
+
}>;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { knowledgeConstants } from "../../constants";
|
|
9
|
+
import { Tooltip } from '@douyinfe/semi-ui';
|
|
10
|
+
import styles from "./index.module.scss";
|
|
11
|
+
import { CloseCircleFilled } from '@ant-design/icons';
|
|
12
|
+
import { useAppSelector, useAppDispatch } from "../../store/hooks";
|
|
13
|
+
import { setQuoteTeachModelList, setQuoteProductList } from "../../store/slices/gimiMenuSlice";
|
|
14
|
+
import { formatSecondsToChinese } from "../../utils/tools";
|
|
15
|
+
import classNames from 'classnames';
|
|
16
|
+
export var TeachModelReferenceContent = function TeachModelReferenceContent(_ref) {
|
|
17
|
+
var item = _ref.item,
|
|
18
|
+
showDuration = _ref.showDuration;
|
|
19
|
+
var quoteTeachModelList = useAppSelector(function (state) {
|
|
20
|
+
return state.gimiMenu.quoteTeachModelList;
|
|
21
|
+
});
|
|
22
|
+
var dispatch = useAppDispatch();
|
|
23
|
+
var onCancel = function onCancel() {
|
|
24
|
+
dispatch(setQuoteTeachModelList({
|
|
25
|
+
quoteTeachModelList: quoteTeachModelList.filter(function (model) {
|
|
26
|
+
return model.teachModelId !== item.teachModelId;
|
|
27
|
+
})
|
|
28
|
+
}));
|
|
29
|
+
};
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: styles.main
|
|
32
|
+
}, item.canCancel && /*#__PURE__*/React.createElement(CloseCircleFilled, {
|
|
33
|
+
className: styles.closeIcon,
|
|
34
|
+
onClick: onCancel
|
|
35
|
+
}), /*#__PURE__*/React.createElement("img", {
|
|
36
|
+
alt: "\u8D44\u6599\u5F15\u7528\u56FE\u7247",
|
|
37
|
+
className: styles.img,
|
|
38
|
+
src: knowledgeConstants.VIDEO_ICON_ADDRESS
|
|
39
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
className: styles.description
|
|
41
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
42
|
+
content: item.teachModelName
|
|
43
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: classNames(item.canCancel ? styles.text_oneline : styles.text_twoline)
|
|
45
|
+
}, item.teachModelName)), item.duration > 0 && showDuration && /*#__PURE__*/React.createElement("div", {
|
|
46
|
+
className: styles.duration
|
|
47
|
+
}, "\u65F6\u957F".concat(formatSecondsToChinese(item.duration), "\u5206\u949F"))));
|
|
48
|
+
};
|
|
49
|
+
export var ProductReferenceContent = function ProductReferenceContent(_ref2) {
|
|
50
|
+
var item = _ref2.item;
|
|
51
|
+
var quoteProductList = useAppSelector(function (state) {
|
|
52
|
+
return state.gimiMenu.quoteProductList;
|
|
53
|
+
});
|
|
54
|
+
var dispatch = useAppDispatch();
|
|
55
|
+
var onCancel = function onCancel() {
|
|
56
|
+
dispatch(setQuoteProductList({
|
|
57
|
+
quoteProductList: quoteProductList.filter(function (model) {
|
|
58
|
+
return model.productId !== item.productId;
|
|
59
|
+
})
|
|
60
|
+
}));
|
|
61
|
+
};
|
|
62
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: styles.main
|
|
64
|
+
}, item.canCancel && /*#__PURE__*/React.createElement(CloseCircleFilled, {
|
|
65
|
+
className: styles.closeIcon,
|
|
66
|
+
onClick: onCancel
|
|
67
|
+
}), /*#__PURE__*/React.createElement("img", {
|
|
68
|
+
alt: "\u8D44\u6599\u5F15\u7528\u56FE\u7247",
|
|
69
|
+
className: styles.img,
|
|
70
|
+
src: knowledgeConstants.CLASS_ICON_BIG_ADDRESS
|
|
71
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
72
|
+
className: styles.description
|
|
73
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
74
|
+
content: item.productName
|
|
75
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
76
|
+
className: styles.product_text
|
|
77
|
+
}, item.productName))));
|
|
78
|
+
};
|
|
79
|
+
export var ReferencesEdit = function ReferencesEdit(_ref3) {
|
|
80
|
+
var quoteTeachModelList = _ref3.quoteTeachModelList,
|
|
81
|
+
quoteProductList = _ref3.quoteProductList;
|
|
82
|
+
//处理数据 为每项元素增加 canCancel: true
|
|
83
|
+
var newQuoteTeachModelList = quoteTeachModelList.map(function (item) {
|
|
84
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
85
|
+
canCancel: true
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
var newQuoteProductList = quoteProductList.map(function (item) {
|
|
89
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
90
|
+
canCancel: true
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
94
|
+
className: styles.list
|
|
95
|
+
}, newQuoteTeachModelList.map(function (item) {
|
|
96
|
+
return /*#__PURE__*/React.createElement(TeachModelReferenceContent, {
|
|
97
|
+
item: item,
|
|
98
|
+
key: item.teachModelId,
|
|
99
|
+
showDuration: true
|
|
100
|
+
});
|
|
101
|
+
}), newQuoteProductList.map(function (item) {
|
|
102
|
+
return /*#__PURE__*/React.createElement(ProductReferenceContent, {
|
|
103
|
+
item: item,
|
|
104
|
+
key: item.productId
|
|
105
|
+
});
|
|
106
|
+
}));
|
|
107
|
+
};
|
|
108
|
+
export var References = function References(_ref4) {
|
|
109
|
+
var quoteTeachModelList = _ref4.quoteTeachModelList,
|
|
110
|
+
quoteProductList = _ref4.quoteProductList;
|
|
111
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
112
|
+
className: styles.list
|
|
113
|
+
}, quoteTeachModelList === null || quoteTeachModelList === void 0 ? void 0 : quoteTeachModelList.filter(Boolean).map(function (item) {
|
|
114
|
+
return /*#__PURE__*/React.createElement(TeachModelReferenceContent, {
|
|
115
|
+
item: item,
|
|
116
|
+
key: item.teachModelId,
|
|
117
|
+
showDuration: false
|
|
118
|
+
});
|
|
119
|
+
}), quoteProductList === null || quoteProductList === void 0 ? void 0 : quoteProductList.filter(Boolean).map(function (item) {
|
|
120
|
+
return /*#__PURE__*/React.createElement(ProductReferenceContent, {
|
|
121
|
+
item: item,
|
|
122
|
+
key: item.productId
|
|
123
|
+
});
|
|
124
|
+
}));
|
|
125
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Variables
|
|
2
|
+
$font-family: 'PingFang SC';
|
|
3
|
+
@mixin text-ellipsis($lines: 2) {
|
|
4
|
+
text-overflow: ellipsis;
|
|
5
|
+
display: -webkit-box;
|
|
6
|
+
-webkit-line-clamp: $lines;
|
|
7
|
+
-webkit-box-orient: vertical;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
width: 200px;
|
|
10
|
+
font-family: $font-family;
|
|
11
|
+
font-weight: 500;
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
line-height: 150%;
|
|
14
|
+
letter-spacing: 0px;
|
|
15
|
+
color: #2e394c;
|
|
16
|
+
}
|
|
17
|
+
.list {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
align-items: end;
|
|
21
|
+
gap: 10px;
|
|
22
|
+
margin-bottom: 10px;
|
|
23
|
+
}
|
|
24
|
+
.main {
|
|
25
|
+
background-color: #f7f8fa;
|
|
26
|
+
border-radius: 12px;
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
gap: 10px;
|
|
30
|
+
padding: 10px;
|
|
31
|
+
position: relative;
|
|
32
|
+
min-height: 60px;
|
|
33
|
+
|
|
34
|
+
.img {
|
|
35
|
+
height: 28px;
|
|
36
|
+
width: 28px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.description {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
gap: 5px;
|
|
43
|
+
|
|
44
|
+
.text_oneline {
|
|
45
|
+
@include text-ellipsis(1);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.text_twoline {
|
|
49
|
+
@include text-ellipsis(2);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.product_text {
|
|
53
|
+
@include text-ellipsis(2);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.duration {
|
|
57
|
+
color: #717f94;
|
|
58
|
+
font-family: $font-family;
|
|
59
|
+
font-weight: 400;
|
|
60
|
+
font-style: Regular;
|
|
61
|
+
font-size: 12px;
|
|
62
|
+
line-height: 150%;
|
|
63
|
+
letter-spacing: 0px;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.closeIcon {
|
|
68
|
+
position: absolute;
|
|
69
|
+
top: 0;
|
|
70
|
+
right: 0;
|
|
71
|
+
transform: translate(5px, -5px);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CommonChatProps } from '../../types/chat';
|
|
3
|
+
import { CommonChatRef } from '../../types/chat';
|
|
4
|
+
declare const CommonChat: React.ForwardRefExoticComponent<CommonChatProps & React.RefAttributes<CommonChatRef>>;
|
|
5
|
+
export default CommonChat;
|