@topthink/chat 1.3.8 → 1.3.9
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/es/index.js +1 -1
- package/package.json +2 -2
package/es/index.js
CHANGED
|
@@ -735,7 +735,7 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{styled as
|
|
|
735
735
|
&::before {
|
|
736
736
|
transform: scale(1.4)
|
|
737
737
|
}
|
|
738
|
-
`,yr=L(({message:n,actions:i,setMessage:o,cite:s,speech:a,isLast:l})=>{const{query:c,quote:d,files:u=[],chunks:m,annotation:h,loading:p}=n,{user:g,bot:f,logLevel:b="none",messages:v,renderFileItem:y}=Ce(),x=A(()=>m?m.reduce(function(e,t){const r=Array.isArray(t.content)?t.content.reduce((e,t)=>{const r=gt(t);return r?e+r+"\n":e},""):gt(t.content);return e+r+"\n"+(t.tools||[]).reduce((e,t)=>{if(t.content){const r=gt(t.content);if(r)return e+r+"\n"}return e},"")},""):"",[m]),k=R(null),N=R(null),j=R(null),C=c||u.length>0;return t(r,{children:[C&&t(Sr,{$reverse:!0,children:[g&&e(Cr,{children:e("img",{src:g.avatar})}),e($r,{}),t(Rr,{ref:k,children:[c&&e(kt,{content:c}),d&&e(Q,{trigger:"click",container:k,rootClose:!0,placement:"bottom",overlay:e(xr,{body:!0,children:d}),children:e(kr,{children:e(wr,{children:d})})}),u.length>0&&u.map(({name:t,size:r,path:n},i)=>{if(E(n))return e(Ft,{src:`/uploads/${n}`},i);const o={name:t,url:`/uploads/${n}`,size:r};return e(Er,{children:y?y({Component:fe,props:o}):e(fe,{...o})},i)})]})]}),m&&t(Sr,{children:[f&&e(Cr,{ref:N,children:e("img",{src:f.avatar})}),e($r,{}),t(Rr,{children:[C&&!1!==i&&t(Nr,{children:[e(w,{placement:"top",content:x,as:$t,tooltip:!0}),a&&e(fr,{loading:n.loading,avatarRef:N,contentRef:j,...a}),i?.({Component:$t,message:n,content:x,setMessage:o,messages:v})]}),e(jr,{children:["stats","all"].includes(b)&&n.stats&&t(r,{children:[t("span",{children:["耗时 ",n.stats.latency/1e3," 秒"]}),t("span",{children:["花费 Token ",n.stats.usage]})]})}),e(dr,{ref:j,chunks:m,loading:p,isLast:l,cite:s,deleted:!!h}),h&&t("div",{children:[t("div",{className:"d-flex align-items-center",children:[e("span",{className:"fs-7 text-secondary me-2",children:"标注的答案"}),e("hr",{className:"flex-fill"})]}),e(kt,{content:h.answer})]}),n.loading&&e(pt,{})]})]})]})}),xr=n(J)`
|
|
738
|
+
`,yr=L(({message:n,actions:i,setMessage:o,cite:s,speech:a,isLast:l})=>{const{query:c,quote:d,files:u=[],chunks:m,annotation:h,loading:p}=n,{user:g,bot:f,logLevel:b="none",messages:v,renderFileItem:y}=Ce(),x=A(()=>m?m.reduce(function(e,t){const r=Array.isArray(t.content)?t.content.reduce((e,t)=>{const r=gt(t);return r?e+r+"\n":e},""):gt(t.content);return e+r+"\n"+(t.tools||[]).reduce((e,t)=>{if(t.content){const r=gt(t.content);if(r)return e+r+"\n"}return e},"")},""):"",[m]),k=R(null),N=R(null),j=R(null),C=c||u.length>0;return t(r,{children:[C&&t(Sr,{$reverse:!0,children:[g&&t(r,{children:[e(Cr,{children:e("img",{src:g.avatar})}),e($r,{})]}),t(Rr,{ref:k,children:[c&&e(kt,{content:c}),d&&e(Q,{trigger:"click",container:k,rootClose:!0,placement:"bottom",overlay:e(xr,{body:!0,children:d}),children:e(kr,{children:e(wr,{children:d})})}),u.length>0&&u.map(({name:t,size:r,path:n},i)=>{if(E(n))return e(Ft,{src:`/uploads/${n}`},i);const o={name:t,url:`/uploads/${n}`,size:r};return e(Er,{children:y?y({Component:fe,props:o}):e(fe,{...o})},i)})]})]}),m&&t(Sr,{children:[f&&t(r,{children:[e(Cr,{ref:N,children:e("img",{src:f.avatar})}),e($r,{})]}),t(Rr,{children:[C&&!1!==i&&t(Nr,{children:[e(w,{placement:"top",content:x,as:$t,tooltip:!0}),a&&e(fr,{loading:n.loading,avatarRef:N,contentRef:j,...a}),i?.({Component:$t,message:n,content:x,setMessage:o,messages:v})]}),e(jr,{children:["stats","all"].includes(b)&&n.stats&&t(r,{children:[t("span",{children:["耗时 ",n.stats.latency/1e3," 秒"]}),t("span",{children:["花费 Token ",n.stats.usage]})]})}),e(dr,{ref:j,chunks:m,loading:p,isLast:l,cite:s,deleted:!!h}),h&&t("div",{children:[t("div",{className:"d-flex align-items-center",children:[e("span",{className:"fs-7 text-secondary me-2",children:"标注的答案"}),e("hr",{className:"flex-fill"})]}),e(kt,{content:h.answer})]}),n.loading&&e(pt,{})]})]})]})}),xr=n(J)`
|
|
739
739
|
max-width: calc(100% - .875rem * 2);
|
|
740
740
|
width: calc(100% - .875rem * 2);
|
|
741
741
|
font-size: 1rem;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topthink/chat",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.9",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"prebuild": "rimraf es types",
|
|
6
6
|
"build": "rollup -c --environment NODE_ENV:production",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
},
|
|
72
72
|
"author": "yunwuxin <tzzhangyajun@qq.com> (https://github.com/yunwuxin)",
|
|
73
73
|
"license": "MIT",
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "79fae30348e37ff1a436286310dcb17df4722cf1"
|
|
75
75
|
}
|