@gientech/modual 1.2.8 → 1.2.9-fix

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 (115) hide show
  1. package/README.md +593 -79
  2. package/USAGE.md +56 -0
  3. package/dist/README.md +593 -79
  4. package/dist/assets/GientechStreamReader-C21-q_Qv.js +449 -0
  5. package/dist/assets/chevron-down-DjLtKwcs.js +280 -0
  6. package/dist/assets/databse.svg +6 -0
  7. package/dist/assets/graph.svg +4 -0
  8. package/dist/assets/homeBg.png +0 -0
  9. package/dist/assets/index-BMz4lcjQ.js +1 -0
  10. package/dist/assets/index-C3Viu8Oj.js +1 -0
  11. package/dist/assets/index-C9GlPyHu.js +13 -0
  12. package/dist/assets/index-CRbX3ZA1.js +1 -0
  13. package/dist/assets/index-CTwzi_v2.js +21 -0
  14. package/dist/assets/index-DQlLDleQ.js +11 -0
  15. package/dist/assets/index-DRU1P9R0.js +1150 -0
  16. package/dist/assets/index-Dqej68NT.js +585 -0
  17. package/dist/assets/index-ECprhahs.js +157 -0
  18. package/dist/assets/index-i7qcZOwY.js +1088 -0
  19. package/dist/assets/knowledge.svg +4 -0
  20. package/dist/assets/left.jpg +0 -0
  21. package/dist/assets/logoImg.png +0 -0
  22. package/dist/assets/{plus-omCUN0e3.js → plus-CvJRSbOe.js} +1 -1
  23. package/dist/assets/sensitive.svg +5 -0
  24. package/dist/assets/style.css +1 -1
  25. package/dist/assets/style3.css +1 -1
  26. package/dist/assets/worker-BbpylX7l.js +13 -0
  27. package/dist/assets/{x-vPcWt3fC.js → x-DKPeLdlu.js} +1 -1
  28. package/dist/assistantConfig.d.ts +31 -0
  29. package/dist/assistantConfig.js +1 -0
  30. package/dist/chat.d.ts +25 -1
  31. package/dist/chat.js +563 -369
  32. package/dist/database.js +2 -2
  33. package/dist/databaseId.js +1 -11
  34. package/dist/databaseTable.js +2 -2
  35. package/dist/index.d.ts +85 -0
  36. package/dist/index.js +1 -0
  37. package/dist/modelManage.js +1 -1
  38. package/dist/package.json +13 -1
  39. package/dist/sensitive.js +1 -1
  40. package/dist/streamFilesReader.d.ts +3 -0
  41. package/dist/streamFilesReader.js +1 -442
  42. package/doc_assets//346/226/271/346/241/210//344/274/230/345/214/226/346/226/271/346/241/210-/345/244/232/344/274/232/350/257/235SSE/350/277/236/346/216/245/347/256/241/347/220/206.md +504 -0
  43. package/package.json +125 -99
  44. package/package.json.demo-backup +109 -0
  45. package/scripts/README.md +133 -133
  46. package/scripts/build-demo.js +88 -88
  47. package/scripts/demo-selector.js +216 -216
  48. package/scripts/preview-demo.js +130 -130
  49. package/scripts/run-demo.bat +34 -34
  50. package/src/assets/img/close.png +0 -0
  51. package/src/assets/img/database.png +0 -0
  52. package/src/assets/img/downLoad.png +0 -0
  53. package/src/assets/img/graphIcon.png +0 -0
  54. package/src/assets/img/pdf.png +0 -0
  55. package/src/assets/img/singleQa.png +0 -0
  56. package/src/assets/img/webSearch.png +0 -0
  57. package/src/examples/ConversationAssistantPage/index.tsx +37 -0
  58. package/src/examples/Demo/index.tsx +12 -0
  59. package/src/examples/chat/components/DrawerGraphPreview.tsx +78 -0
  60. package/src/examples/chat/index.tsx +112 -99
  61. package/src/examples/chat/logo03.png +0 -0
  62. package/src/examples/gientechStreamFilesReader/index.tsx +4 -69
  63. package/src/lib_enter.ts +11 -6
  64. package/src/modules/assistantConfig/assets/databse.svg +6 -0
  65. package/src/modules/assistantConfig/assets/empty.png +0 -0
  66. package/src/modules/assistantConfig/assets/graph.svg +4 -0
  67. package/src/modules/assistantConfig/assets/knowledge.svg +4 -0
  68. package/src/modules/assistantConfig/assets/sensitive.svg +5 -0
  69. package/src/modules/assistantConfig/components/Database.tsx +144 -0
  70. package/src/modules/assistantConfig/components/Graph.tsx +156 -0
  71. package/src/modules/assistantConfig/components/Knowledge.tsx +266 -0
  72. package/src/modules/assistantConfig/components/NotFoundContent.tsx +21 -0
  73. package/src/modules/assistantConfig/components/Paragraph.tsx +51 -0
  74. package/src/modules/assistantConfig/components/ParamsItem.tsx +39 -0
  75. package/src/modules/assistantConfig/components/ResourceBinderItem.tsx +132 -0
  76. package/src/modules/assistantConfig/components/SearchableSelector.tsx +500 -0
  77. package/src/modules/assistantConfig/components/Sensitive.tsx +179 -0
  78. package/src/modules/assistantConfig/components/SliderInput.tsx +65 -0
  79. package/src/modules/assistantConfig/constants.tsx +74 -0
  80. package/src/modules/assistantConfig/index.tsx +700 -0
  81. package/src/modules/assistantConfig/server.ts +262 -0
  82. package/src/modules/chat/Conversations/List.tsx +76 -9
  83. package/src/modules/chat/Conversations/index.tsx +37 -19
  84. package/src/modules/chat/ReferenceBar.tsx +592 -0
  85. package/src/modules/chat/constants.tsx +29 -6
  86. package/src/modules/chat/data.txt +82 -0
  87. package/src/modules/chat/index.tsx +357 -113
  88. package/src/modules/chat/referenceCom/DeleteModal.tsx +75 -0
  89. package/src/modules/chat/referenceCom/DrawerContent.tsx +136 -0
  90. package/src/modules/chat/referenceCom/DrawerDatabase.tsx +110 -0
  91. package/src/modules/chat/referenceCom/DrawerGraphPreview.tsx +86 -0
  92. package/src/modules/chat/referenceCom/DrawerPreview.tsx +73 -0
  93. package/src/modules/chat/referenceCom/DrawerTitle.tsx +26 -0
  94. package/src/modules/chat/referenceCom/RenameModal.tsx +86 -0
  95. package/src/modules/chat/referenceCom/TagCom.tsx +30 -0
  96. package/src/modules/chat/style.less +3 -0
  97. package/src/modules/chat/utils/index.ts +326 -0
  98. package/src/modules/database/CreateModal.tsx +1 -1
  99. package/src/modules/headlessChat/index.tsx +1 -3
  100. package/src/modules/nodegraph/index.tsx +1 -0
  101. package/src/modules/search/components/ResultContent.tsx +2 -2
  102. package/src/modules/streamFilesReader/GientechStreamReader.tsx +436 -367
  103. package/src/modules/streamFilesReader/index.tsx +1 -1
  104. package/src/utils/gientechCommon/components/AppLoading.tsx +10 -10
  105. package/src/utils/gientechCommon/components/Messages/GientechNewChatWelcome.tsx +312 -27
  106. package/src/utils/gientechCommon/hooks/AichatUseController.tsx +84 -6
  107. package/src/utils/testconfigs/index.ts +7 -1
  108. package/stats.html +1 -1
  109. package/vite.config.ts +69 -20
  110. package/dist/assets/_commonjsHelpers-gnU0ypJ3.js +0 -1
  111. package/dist/assets/circle-alert-g2Y6zAjt.js +0 -6
  112. package/dist/assets/index-97TKgPKE.js +0 -1284
  113. package/dist/assets/index-CEK88UzR.js +0 -26
  114. package/dist/assets/index-DIm7RgkM.js +0 -1709
  115. package/dist/assets/styled-components.browser.esm-DPkS13KC.js +0 -2
@@ -0,0 +1,592 @@
1
+ import { ConfigProvider, Drawer, Tooltip } from 'antd';
2
+ import SingleQa from '../../assets/img/singleQa.png';
3
+ import DownLoad from '../../assets/img/downLoad.png';
4
+ import GraphIcon from '../../assets/img/graphIcon.png';
5
+ import WebSearch from '../../assets/img/webSearch.png';
6
+ import Database from '../../assets/img/database.png';
7
+ import { useEffect, useMemo, useState } from 'react';
8
+ import './style.less';
9
+ import DrawerGraphPreview from './referenceCom/DrawerGraphPreview';
10
+ import { DrawerContent } from './referenceCom/DrawerContent';
11
+ import DrawerPreview from './referenceCom/DrawerPreview';
12
+ import DrawerDatabase from './referenceCom/DrawerDatabase';
13
+ import DrawerTitle from './referenceCom/DrawerTitle';
14
+ import TagCom from './referenceCom/TagCom';
15
+ import {
16
+ downloadByStream,
17
+ getFileIcon,
18
+ getFileName,
19
+ getMarkExcludeType,
20
+ TempBaseUrl,
21
+ } from './utils';
22
+ import { DrawerType } from '../../lib_enter';
23
+
24
+ enum ListName {
25
+ KNOWLEDGE = 'knowledgeList',
26
+ SEARCH = 'searchList',
27
+ DATABASE = 'databaseList',
28
+ GRAPH = 'graphList',
29
+ }
30
+
31
+ export const bgColor: any = {
32
+ [ListName.KNOWLEDGE]: '#EAF4FD',
33
+ [ListName.SEARCH]: '#E8F7F0',
34
+ [ListName.DATABASE]: '#FFF4E5',
35
+ [ListName.GRAPH]: '#E7F8FB',
36
+ };
37
+
38
+ export const textColor: any = {
39
+ [ListName.KNOWLEDGE]: '#2072F0',
40
+ [ListName.SEARCH]: '#39B83F',
41
+ [ListName.DATABASE]: '#F48C14',
42
+ [ListName.GRAPH]: '#10BBD9',
43
+ };
44
+
45
+ const BTNS = [
46
+ {
47
+ key: ListName.KNOWLEDGE,
48
+ name: '知识库文档',
49
+ },
50
+ {
51
+ key: ListName.SEARCH,
52
+ name: '联网搜索',
53
+ hideBtns: true,
54
+ },
55
+ {
56
+ key: ListName.DATABASE,
57
+ name: '数据库',
58
+ },
59
+ {
60
+ key: ListName.GRAPH,
61
+ name: '知识图谱',
62
+ hideBtns: true,
63
+ },
64
+ ];
65
+
66
+ export const ReferenceBar = ({
67
+ type,
68
+ data,
69
+ token,
70
+ eventsEmit,
71
+ is_download,
72
+ }: {
73
+ type: string;
74
+ data: any;
75
+ token: string;
76
+ eventsEmit?: (eventName: string, data: any) => void;
77
+ is_download: boolean;
78
+ }) => {
79
+ const [btns, setBtns] = useState(BTNS);
80
+ const [drawerType, setDrawerType] = useState<string>('mark');
81
+ const [drawerOpen, setDrawerOpen] = useState<boolean>(false);
82
+ const [curFileInfo, setCurFileInfo] = useState<any>({});
83
+ const [activeBtn, setActiveBtn] = useState<any>(ListName.KNOWLEDGE);
84
+ const [lists, seLists] = useState<any>({
85
+ [ListName.KNOWLEDGE]: [],
86
+ [ListName.SEARCH]: [],
87
+ [ListName.DATABASE]: [],
88
+ [ListName.GRAPH]: [],
89
+ });
90
+
91
+ const getEmptyBoxs = useMemo(() => {
92
+ const n = 4 - btns.length;
93
+ const arr = Array(n)
94
+ .fill(null)
95
+ .map((v, i) => {
96
+ return {
97
+ name: '',
98
+ key: 100 + i,
99
+ };
100
+ });
101
+
102
+ const r = [...btns, ...arr];
103
+ console.log('rrrrrr', r);
104
+
105
+ return r;
106
+ }, [btns]);
107
+
108
+ const filterScore = (score: any) => {
109
+ if (isNaN(score)) {
110
+ return '';
111
+ } else {
112
+ return (+score).toFixed(2);
113
+ }
114
+ };
115
+
116
+ const getIcon = (btn: string, filtType?: string) => {
117
+ switch (btn) {
118
+ case ListName.KNOWLEDGE:
119
+ return getFileIcon(filtType as any);
120
+ case ListName.SEARCH:
121
+ return WebSearch;
122
+ case ListName.DATABASE:
123
+ return Database;
124
+ case ListName.GRAPH:
125
+ return GraphIcon;
126
+ }
127
+ };
128
+
129
+ const dealData = (type: string, data: any[]) => {
130
+ if (type === ListName.GRAPH) {
131
+ return data
132
+ .map(item => {
133
+ return {
134
+ ...item,
135
+ name: item.graphName,
136
+ };
137
+ })
138
+ .sort((a, b) => {
139
+ return (b.score || 0) - (a.score || 0);
140
+ });
141
+ }
142
+
143
+ if (type === ListName.KNOWLEDGE) {
144
+ return data
145
+ .map(item => {
146
+ return {
147
+ ...item,
148
+ name: item.file_name,
149
+ score: item.rrf_score,
150
+ };
151
+ })
152
+ .sort((a, b) => {
153
+ return (b.score || 0) - (a.score || 0);
154
+ });
155
+ }
156
+
157
+ if (type === ListName.SEARCH) {
158
+ return data
159
+ .map(item => {
160
+ return {
161
+ ...item,
162
+ name: item.file_name,
163
+ };
164
+ })
165
+ .sort((a, b) => {
166
+ return (b.score || 0) - (a.score || 0);
167
+ });
168
+ }
169
+
170
+ if (type === ListName.DATABASE) {
171
+ return data
172
+ .map(item => {
173
+ // 数据库引用:使用 databaseName 和 tableName 组合作为名称
174
+ const name = item.tableName
175
+ ? `${item.databaseName || '数据库'} - ${item.tableName}`
176
+ : item.databaseName || item.name || '数据库';
177
+ return {
178
+ ...item,
179
+ name,
180
+ file_name: name,
181
+ file_type: 'database',
182
+ };
183
+ })
184
+ .sort((a, b) => {
185
+ return (b.score || 0) - (a.score || 0);
186
+ });
187
+ }
188
+
189
+ return data;
190
+ };
191
+
192
+ const clickTag = (file: any, tag: any, btn: any) => {
193
+ switch (btn.key) {
194
+ case ListName.KNOWLEDGE:
195
+ console.log('click knowledge tag', file, tag);
196
+ const curFile = file;
197
+ const { pdfPages, parsedFilePath, order_num, metadata } = curFile;
198
+ const id = tag.id || order_num || 'Unknown ID';
199
+ // 解析 source 字段
200
+ const sourceParts = metadata.source.split('/');
201
+ const fileName = sourceParts[sourceParts.length - 1] || '';
202
+ const fileParts = fileName.split('.');
203
+ const label = fileParts.slice(0, -1).join('.') || 'Unknown Label';
204
+ const file_type = fileParts[fileParts.length - 1] || 'Unknown Type';
205
+
206
+ setCurFileInfo({
207
+ id,
208
+ title: label,
209
+ file_name: fileName,
210
+ file_type: file_type,
211
+ file_source: getMarkExcludeType(file_type)
212
+ ? `${TempBaseUrl}${metadata.source}`
213
+ : parsedFilePath,
214
+ metadata: metadata,
215
+ pdfPages: pdfPages,
216
+ });
217
+ setDrawerType('mark');
218
+ setDrawerOpen(true);
219
+ break;
220
+ case ListName.SEARCH:
221
+ console.log('click search tag', file, tag);
222
+ break;
223
+ case ListName.DATABASE:
224
+ console.log('click database tag', file, tag);
225
+ // 打开数据库详情抽屉
226
+ setDrawerType('database');
227
+ setCurFileInfo({
228
+ ...file,
229
+ metadata: file.metadata || {},
230
+ fetchUrl: file.fetchUrl || file.metadata?.fetchUrl || '',
231
+ });
232
+ setDrawerOpen(true);
233
+ break;
234
+ case ListName.GRAPH:
235
+ console.log('click graph tag', file, tag);
236
+ setDrawerType('graphPreview');
237
+ setCurFileInfo({
238
+ ...file,
239
+ traceNode: (data?.traceNode || []).find((item: any) => {
240
+ return item.id === tag.id;
241
+ }),
242
+ });
243
+ setDrawerOpen(true);
244
+ break;
245
+ }
246
+ };
247
+
248
+ useEffect(() => {
249
+ if (type !== DrawerType.REFERENCELIST) return;
250
+ console.log('data in reference drawer', data);
251
+ if (!data) return;
252
+ const { graphRefs, knowledgeRefs, webRefs, databaseRefs } = data;
253
+ if (graphRefs?.length) {
254
+ lists[ListName.GRAPH] = dealData(ListName.GRAPH, graphRefs);
255
+ }
256
+ if (knowledgeRefs?.length) {
257
+ lists[ListName.KNOWLEDGE] = dealData(ListName.KNOWLEDGE, knowledgeRefs);
258
+ }
259
+ if (webRefs?.length) {
260
+ lists[ListName.SEARCH] = dealData(ListName.SEARCH, webRefs);
261
+ }
262
+ // 处理数据库引用(使用摘要信息,不包含完整数据行)
263
+ if (databaseRefs?.length) {
264
+ lists[ListName.DATABASE] = dealData(ListName.DATABASE, databaseRefs);
265
+ }
266
+
267
+ const curBtns = BTNS.filter((item: any) => {
268
+ return lists[item.key]?.length;
269
+ }).sort((a, b) => {
270
+ return (lists[b.key]?.length || 0) - (lists[a.key]?.length || 0);
271
+ });
272
+
273
+ setBtns(curBtns);
274
+
275
+ if (curBtns?.length) {
276
+ setActiveBtn(curBtns[0].key);
277
+ }
278
+
279
+ seLists({ ...lists });
280
+ }, [data]);
281
+
282
+ return (
283
+ <>
284
+ <div className="listWrap w-full h-full">
285
+ <DrawerTitle
286
+ title="知识溯源"
287
+ setOpen={() => {
288
+ const closeEvent = new CustomEvent('aichat:right_set', {
289
+ detail: { collapsed: true },
290
+ });
291
+ window.dispatchEvent(closeEvent);
292
+ }}
293
+ />
294
+ <div style={{ height: 'calc(100% - 60px)' }}>
295
+ <div
296
+ className="tabs"
297
+ style={{ display: 'flex', justifyContent: 'space-between', padding: '12px 20px' }}
298
+ >
299
+ {getEmptyBoxs.map(item => (
300
+ <div
301
+ key={item.key}
302
+ className="tab-item"
303
+ style={{
304
+ display: 'inline-block',
305
+ padding: '5.5px 12px',
306
+ backgroundColor: !item.name
307
+ ? 'transparent'
308
+ : activeBtn === item.key
309
+ ? '#4E6EF2'
310
+ : '#F5F6F9',
311
+ cursor: 'pointer',
312
+ borderRadius: '4px',
313
+ color: activeBtn === item.key ? '#FFFFFF' : '#4E5969',
314
+ fontSize: '14px',
315
+ minWidth: '80px',
316
+ }}
317
+ onClick={() => {
318
+ if (item.name) {
319
+ setActiveBtn(item.key);
320
+ }
321
+ }}
322
+ >
323
+ {item.name}
324
+ </div>
325
+ ))}
326
+ </div>
327
+ <div
328
+ className="listBox"
329
+ style={{
330
+ height: 'calc(100% - 66px)',
331
+ overflowY: 'auto',
332
+ display: 'flex',
333
+ flexDirection: 'column',
334
+ alignItems: 'center',
335
+ }}
336
+ >
337
+ {btns.map((item: any) => {
338
+ let list: any[] = lists[item.key] || [];
339
+ if (activeBtn !== item.key) return null;
340
+ return (
341
+ <div key={item.key}>
342
+ {list.map(
343
+ (i: {
344
+ name: string;
345
+ id: string;
346
+ score: number | string;
347
+ tags?: any[];
348
+ hideBtns?: boolean;
349
+ file_type?: string;
350
+ link?: string;
351
+ metadata: any;
352
+ file_name: any;
353
+ parsedFilePath: any;
354
+ fetchUrl?: string;
355
+ }) => {
356
+ return (
357
+ <div
358
+ key={i.id}
359
+ style={{
360
+ width: '360px',
361
+ padding: '4px 8px',
362
+ borderRadius: '4px',
363
+ margin: '6px 0',
364
+ cursor: 'pointer',
365
+ }}
366
+ className="listItemBox"
367
+ onClick={() => {
368
+ if (item.key === ListName.SEARCH) {
369
+ window.open(i.link, '_blank');
370
+ }
371
+ }}
372
+ >
373
+ <div
374
+ style={{
375
+ display: 'flex',
376
+ justifyContent: 'space-between',
377
+ alignItems: 'center',
378
+ }}
379
+ >
380
+ <div
381
+ style={{
382
+ width: item.hideBtns ? '339px' : '288px',
383
+ fontSize: '14px',
384
+ color: '#1D2129',
385
+ fontWeight: '700',
386
+ display: 'flex',
387
+ alignItems: 'center',
388
+ }}
389
+ >
390
+ <img
391
+ src={getIcon(item.key, i.file_type)}
392
+ style={{ width: '16px', height: '16px', marginRight: '2px' }}
393
+ />
394
+ <Tooltip
395
+ placement="topLeft"
396
+ title={i?.name?.length > 16 ? i.name : ''}
397
+ >
398
+ <div
399
+ style={{
400
+ whiteSpace: 'nowrap',
401
+ overflow: 'hidden',
402
+ textOverflow: 'ellipsis',
403
+ width: item.hideBtns ? '322px' : '258px',
404
+ }}
405
+ onClick={() => {
406
+ if (item.key === ListName.KNOWLEDGE) {
407
+ eventsEmit?.('knowledge_referenceFile_title:click', {
408
+ data: {
409
+ ...i,
410
+ file_type: i.file_type,
411
+ file_name: i.file_name,
412
+ metadata: i.metadata,
413
+ parsedFilePath: i.parsedFilePath,
414
+ },
415
+ });
416
+ } else if (item.key === ListName.DATABASE) {
417
+ // 点击数据库项标题时,打开数据库详情抽屉
418
+ setDrawerType('database');
419
+ setCurFileInfo({
420
+ ...i,
421
+ metadata: i.metadata || {},
422
+ fetchUrl: i.fetchUrl || i.metadata?.fetchUrl || '',
423
+ });
424
+ setDrawerOpen(true);
425
+ }
426
+ }}
427
+ >
428
+ {i.name}
429
+ </div>
430
+ </Tooltip>
431
+ </div>
432
+ <div
433
+ style={{
434
+ width: '52px',
435
+ justifyContent: 'space-between',
436
+ alignItems: 'center',
437
+ marginRight: '8px',
438
+ display: item.hideBtns ? 'none' : 'flex',
439
+ }}
440
+ >
441
+ <img
442
+ src={SingleQa}
443
+ style={{ width: '16px', height: '16px', cursor: 'pointer' }}
444
+ onClick={() => {
445
+ eventsEmit?.('referenceFile_filechat', {
446
+ data: {
447
+ ...i,
448
+ file_type: i.file_type,
449
+ file_name: i.file_name,
450
+ metadata: i.metadata,
451
+ parsedFilePath: i.parsedFilePath,
452
+ },
453
+ });
454
+ }}
455
+ />
456
+ <div
457
+ style={{ borderRight: '1px solid #E5E6EB', height: '14px' }}
458
+ ></div>
459
+ <img
460
+ src={DownLoad}
461
+ style={{
462
+ width: '16px',
463
+ height: '16px',
464
+ cursor: is_download ? 'pointer' : 'not-allowed',
465
+ }}
466
+ onClick={() => {
467
+ if (!i?.metadata || !is_download) return;
468
+ downloadByStream({
469
+ filePath: `${TempBaseUrl}${i.metadata.source}`,
470
+ fileName: getFileName(i),
471
+ token,
472
+ });
473
+ }}
474
+ />
475
+ </div>
476
+ </div>
477
+ {!!(
478
+ typeof i.score === 'string' ||
479
+ typeof i.score === 'number' ||
480
+ (i?.tags?.length && i.tags.length > 0 && i.tags.length <= 10)
481
+ ) && (
482
+ <div
483
+ style={{
484
+ display: 'flex',
485
+ justifyContent: 'space-between',
486
+ height: '18px',
487
+ marginTop: '4px',
488
+ }}
489
+ >
490
+ {(typeof i.score === 'string' || typeof i.score === 'number') && (
491
+ <div
492
+ style={{
493
+ backgroundColor: '#F2F2FB',
494
+ borderRadius: '4px',
495
+ padding: '2px 3px',
496
+ display: 'flex',
497
+ justifyContent: 'center',
498
+ alignItems: 'center',
499
+ fontSize: '12px',
500
+ }}
501
+ >
502
+ <span style={{ color: '#4E5969', marginRight: '6px' }}>
503
+ 分数:
504
+ </span>
505
+ <span style={{ color: '#1D2129' }}>{filterScore(i.score)}</span>
506
+ </div>
507
+ )}
508
+ <div style={{ flex: 1, display: 'flex', justifyContent: 'flex-end' }}>
509
+ {(i?.tags?.length && i.tags.length > 0 && i.tags.length <= 10
510
+ ? i.tags
511
+ : []
512
+ ).map((j: any) => {
513
+ return (
514
+ <TagCom
515
+ key={j.id}
516
+ i={i}
517
+ item={item}
518
+ j={j}
519
+ clickTag={clickTag}
520
+ />
521
+ );
522
+ })}
523
+ </div>
524
+ </div>
525
+ )}
526
+ <div
527
+ style={{
528
+ flex: 1,
529
+ display: 'flex',
530
+ justifyContent: 'flex-start',
531
+ marginTop: '4px',
532
+ }}
533
+ >
534
+ {(i?.tags?.length && i.tags.length > 10 ? i.tags : []).map((j: any) => {
535
+ return (
536
+ <TagCom key={j.id} i={i} item={item} j={j} clickTag={clickTag} />
537
+ );
538
+ })}
539
+ </div>
540
+ </div>
541
+ );
542
+ }
543
+ )}
544
+ </div>
545
+ );
546
+ })}
547
+ </div>
548
+ </div>
549
+ </div>
550
+ <ConfigProvider
551
+ drawer={{
552
+ styles: {
553
+ body: { padding: 0 },
554
+ header: { display: 'none' },
555
+ },
556
+ }}
557
+ >
558
+ <Drawer
559
+ autoFocus={false}
560
+ onClose={() => setDrawerOpen(false)}
561
+ open={drawerOpen}
562
+ width={720}
563
+ className="overflow-x-hidden"
564
+ destroyOnClose
565
+ getContainer={false}
566
+ afterOpenChange={open => {
567
+ if (!open) {
568
+ setCurFileInfo(null);
569
+ }
570
+ }}
571
+ >
572
+ {drawerType === 'graphPreview' && (
573
+ <DrawerGraphPreview
574
+ curFileInfo={curFileInfo as any}
575
+ onClose={setDrawerOpen}
576
+ token={token}
577
+ />
578
+ )}
579
+ {drawerType === 'mark' && (
580
+ <DrawerContent content={curFileInfo as any} onClose={setDrawerOpen} token={token} />
581
+ )}
582
+ {drawerType === 'preview' && (
583
+ <DrawerPreview curFileInfo={curFileInfo} onClose={setDrawerOpen} token={token} />
584
+ )}
585
+ {drawerType === 'database' && (
586
+ <DrawerDatabase curFileInfo={curFileInfo} onClose={setDrawerOpen} />
587
+ )}
588
+ </Drawer>
589
+ </ConfigProvider>
590
+ </>
591
+ );
592
+ };
@@ -1,30 +1,53 @@
1
1
  import { Icon } from '@mxmweb/zui';
2
+ import { FileSymlink, Mic, Paperclip } from 'lucide-react';
2
3
 
3
4
  export const DefaultSenderConfig = {
4
5
  actions: [
5
6
  {
6
- icon: <Icon type='rag/folder' size={18} />,
7
7
  name: 'history',
8
- badgeCount: 0,
8
+ icon: <Paperclip color='#4E5969' size={20}/>,
9
+ // badgeCount: 0,
10
+ tip: '录音',
9
11
  },
12
+ {
13
+ name: 'upload',
14
+ icon: <Mic color='#4E5969' size={20}/>,
15
+ tip: '上传',
16
+ }
10
17
  ],
11
18
 
19
+ // {
20
+ // name: 'reasoning',
21
+ // label: '思维链',
22
+ // type: 'switch' as const,
23
+ // defaultValue: false,
24
+ // enabled: true,
25
+ // icon: <LoaderPinwheel size={16} />,
26
+ // },
27
+ // {
28
+ // name: 'netSearch',
29
+ // label: '网络搜索',
30
+ // type: 'switch' as const,
31
+ // defaultValue: true,
32
+ // enabled: true,
33
+ // icon: <Globe size={16} />,
34
+ // },
12
35
  switchs: [
13
36
  {
14
37
  label: '联网搜索',
15
38
  name: 'netSearch',
16
- type: 'checkbox',
39
+ type: 'switch',
17
40
  defaultValue: false,
18
41
  enabled: true,
19
- icon: <Icon type='rag/url' size={12} />,
42
+ icon: <Icon type='rag/url' size={16} />,
20
43
  },
21
44
  {
22
45
  label: '推理思考',
23
46
  name: 'reasoning',
24
- type: 'checkbox',
47
+ type: 'switch',
25
48
  defaultValue: false,
26
49
  enabled: true,
27
- icon: <Icon type='rag/think' size={12} />,
50
+ icon: <Icon type='rag/think' size={16} />,
28
51
  },
29
52
  ],
30
53
  };