@zero-library/chat-agent 2.2.11 → 2.2.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.
- package/dist/index.cjs.js +4 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +12 -8
- package/dist/index.d.ts +12 -8
- package/dist/index.esm.js +4 -5
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -492,19 +492,21 @@ interface FileTextType {
|
|
|
492
492
|
/**
|
|
493
493
|
* 引用内容接口
|
|
494
494
|
* 扩展消息引用信息,支持更多引用格式
|
|
495
|
+
* @remarks
|
|
496
|
+
* 包含引用名称、引用内容、引用参数;
|
|
497
|
+
* SenderHeader显示顺序:name > msgContent > msgFiles
|
|
498
|
+
* MessageQuoteMsg显示顺序:quoteMsg > params.citation
|
|
495
499
|
*
|
|
496
500
|
* @example
|
|
497
501
|
* // 引用文档片段
|
|
498
502
|
* const quote: ReferencesContent = {
|
|
499
503
|
* name: '法规条款',
|
|
500
|
-
*
|
|
504
|
+
* msgContent: '> 根据《企业所得税法》第XX条规定...',
|
|
501
505
|
* }
|
|
502
506
|
*/
|
|
503
507
|
interface ReferencesContent extends MessageQuoteMsg {
|
|
504
508
|
/** 引用名称 */
|
|
505
509
|
name?: string;
|
|
506
|
-
/** Markdown格式的引用内容 */
|
|
507
|
-
markdown?: string;
|
|
508
510
|
}
|
|
509
511
|
/**
|
|
510
512
|
* 引用类型接口
|
|
@@ -516,7 +518,7 @@ interface ReferencesContent extends MessageQuoteMsg {
|
|
|
516
518
|
* type: 1,
|
|
517
519
|
* content: {
|
|
518
520
|
* name: '法规摘要',
|
|
519
|
-
*
|
|
521
|
+
* msgContent: '> 根据相关规定...'
|
|
520
522
|
* },
|
|
521
523
|
* params: {
|
|
522
524
|
* source: 'law-001'
|
|
@@ -528,7 +530,9 @@ interface ReferencesContent extends MessageQuoteMsg {
|
|
|
528
530
|
* type: 2,
|
|
529
531
|
* content: {
|
|
530
532
|
* name: '参考答案',
|
|
531
|
-
*
|
|
533
|
+
* },
|
|
534
|
+
* params: {
|
|
535
|
+
* citation: '建议按以下方式处理...'
|
|
532
536
|
* }
|
|
533
537
|
* }
|
|
534
538
|
*
|
|
@@ -542,7 +546,7 @@ interface ReferencesContent extends MessageQuoteMsg {
|
|
|
542
546
|
* }
|
|
543
547
|
*/
|
|
544
548
|
interface ReferencesType {
|
|
545
|
-
/** 引用类型:1-
|
|
549
|
+
/** 引用类型:1-Markdown引用(拼正文发) 2-文案引用(不发正文) 3-消息引用 */
|
|
546
550
|
type: number;
|
|
547
551
|
/** 引用内容 */
|
|
548
552
|
content: ReferencesContent;
|
|
@@ -1318,7 +1322,7 @@ interface ChatConfig {
|
|
|
1318
1322
|
* type: 1,
|
|
1319
1323
|
* content: {
|
|
1320
1324
|
* name: '法规条款',
|
|
1321
|
-
*
|
|
1325
|
+
* msgContent: '> 根据《企业所得税法》第XX条规定...'
|
|
1322
1326
|
* }
|
|
1323
1327
|
* })
|
|
1324
1328
|
*
|
|
@@ -1391,7 +1395,7 @@ interface ChatHandle {
|
|
|
1391
1395
|
* type: 1,
|
|
1392
1396
|
* content: {
|
|
1393
1397
|
* name: '法规条款',
|
|
1394
|
-
*
|
|
1398
|
+
* msgContent: '> 根据《企业所得税法》第XX条规定...'
|
|
1395
1399
|
* },
|
|
1396
1400
|
* params: {
|
|
1397
1401
|
* source: 'law-001'
|
package/dist/index.d.ts
CHANGED
|
@@ -492,19 +492,21 @@ interface FileTextType {
|
|
|
492
492
|
/**
|
|
493
493
|
* 引用内容接口
|
|
494
494
|
* 扩展消息引用信息,支持更多引用格式
|
|
495
|
+
* @remarks
|
|
496
|
+
* 包含引用名称、引用内容、引用参数;
|
|
497
|
+
* SenderHeader显示顺序:name > msgContent > msgFiles
|
|
498
|
+
* MessageQuoteMsg显示顺序:quoteMsg > params.citation
|
|
495
499
|
*
|
|
496
500
|
* @example
|
|
497
501
|
* // 引用文档片段
|
|
498
502
|
* const quote: ReferencesContent = {
|
|
499
503
|
* name: '法规条款',
|
|
500
|
-
*
|
|
504
|
+
* msgContent: '> 根据《企业所得税法》第XX条规定...',
|
|
501
505
|
* }
|
|
502
506
|
*/
|
|
503
507
|
interface ReferencesContent extends MessageQuoteMsg {
|
|
504
508
|
/** 引用名称 */
|
|
505
509
|
name?: string;
|
|
506
|
-
/** Markdown格式的引用内容 */
|
|
507
|
-
markdown?: string;
|
|
508
510
|
}
|
|
509
511
|
/**
|
|
510
512
|
* 引用类型接口
|
|
@@ -516,7 +518,7 @@ interface ReferencesContent extends MessageQuoteMsg {
|
|
|
516
518
|
* type: 1,
|
|
517
519
|
* content: {
|
|
518
520
|
* name: '法规摘要',
|
|
519
|
-
*
|
|
521
|
+
* msgContent: '> 根据相关规定...'
|
|
520
522
|
* },
|
|
521
523
|
* params: {
|
|
522
524
|
* source: 'law-001'
|
|
@@ -528,7 +530,9 @@ interface ReferencesContent extends MessageQuoteMsg {
|
|
|
528
530
|
* type: 2,
|
|
529
531
|
* content: {
|
|
530
532
|
* name: '参考答案',
|
|
531
|
-
*
|
|
533
|
+
* },
|
|
534
|
+
* params: {
|
|
535
|
+
* citation: '建议按以下方式处理...'
|
|
532
536
|
* }
|
|
533
537
|
* }
|
|
534
538
|
*
|
|
@@ -542,7 +546,7 @@ interface ReferencesContent extends MessageQuoteMsg {
|
|
|
542
546
|
* }
|
|
543
547
|
*/
|
|
544
548
|
interface ReferencesType {
|
|
545
|
-
/** 引用类型:1-
|
|
549
|
+
/** 引用类型:1-Markdown引用(拼正文发) 2-文案引用(不发正文) 3-消息引用 */
|
|
546
550
|
type: number;
|
|
547
551
|
/** 引用内容 */
|
|
548
552
|
content: ReferencesContent;
|
|
@@ -1318,7 +1322,7 @@ interface ChatConfig {
|
|
|
1318
1322
|
* type: 1,
|
|
1319
1323
|
* content: {
|
|
1320
1324
|
* name: '法规条款',
|
|
1321
|
-
*
|
|
1325
|
+
* msgContent: '> 根据《企业所得税法》第XX条规定...'
|
|
1322
1326
|
* }
|
|
1323
1327
|
* })
|
|
1324
1328
|
*
|
|
@@ -1391,7 +1395,7 @@ interface ChatHandle {
|
|
|
1391
1395
|
* type: 1,
|
|
1392
1396
|
* content: {
|
|
1393
1397
|
* name: '法规条款',
|
|
1394
|
-
*
|
|
1398
|
+
* msgContent: '> 根据《企业所得税法》第XX条规定...'
|
|
1395
1399
|
* },
|
|
1396
1400
|
* params: {
|
|
1397
1401
|
* source: 'law-001'
|
package/dist/index.esm.js
CHANGED
|
@@ -844,8 +844,8 @@ function createChatStore() {
|
|
|
844
844
|
msgContent = message2;
|
|
845
845
|
msgFiles = files;
|
|
846
846
|
} else {
|
|
847
|
-
if (references?.type === 1 && references?.content?.
|
|
848
|
-
msgContent = references.content.
|
|
847
|
+
if (references?.type === 1 && references?.content?.msgContent) {
|
|
848
|
+
msgContent = references.content.msgContent + "\n";
|
|
849
849
|
}
|
|
850
850
|
msgContent = msgContent + conversation.messages[conversationId].content;
|
|
851
851
|
msgFiles = conversation.messages[conversationId].files;
|
|
@@ -2121,7 +2121,7 @@ var layouts_default = forwardRef(({ theme, params, userInfo, hooks, layout, conf
|
|
|
2121
2121
|
/* @__PURE__ */ jsx(Splitter.Panel, { collapsible: false, min: 600, size: sizes[0], children: hasPreView && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2122
2122
|
configState.preview.file.fileUrl && /* @__PURE__ */ jsxs(Flex, { vertical: true, className: "height-full", children: [
|
|
2123
2123
|
/* @__PURE__ */ jsxs(Flex, { justify: "space-between", align: "center", gap: 16, className: styles_module_default4.nsPreviewHeader, children: [
|
|
2124
|
-
/* @__PURE__ */ jsx("div", { className: styles_module_default4.nsPreviewHeaderTitle, children: configState.preview.file.fileName }),
|
|
2124
|
+
/* @__PURE__ */ jsx("div", { className: classNames9(styles_module_default4.nsPreviewHeaderTitle, "text-ellipsis"), title: configState.preview.file.fileName, children: configState.preview.file.fileName }),
|
|
2125
2125
|
/* @__PURE__ */ jsxs(Flex, { gap: 8, justify: "center", align: "center", children: [
|
|
2126
2126
|
/* @__PURE__ */ jsx(
|
|
2127
2127
|
Button,
|
|
@@ -2153,8 +2153,7 @@ var layouts_default = forwardRef(({ theme, params, userInfo, hooks, layout, conf
|
|
|
2153
2153
|
chatStore.setReferences({
|
|
2154
2154
|
type: 2,
|
|
2155
2155
|
content: {
|
|
2156
|
-
name: text
|
|
2157
|
-
markdown: text
|
|
2156
|
+
name: text
|
|
2158
2157
|
},
|
|
2159
2158
|
params: {
|
|
2160
2159
|
citation: text
|