wi-chat 0.6.1 → 0.7.0
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/core/index.cjs +1 -1
- package/dist/core/index.d.ts +12 -0
- package/dist/core/index.js +737 -322
- package/dist/core/useAnswerActions.d.ts +61 -0
- package/dist/core/useChat.d.ts +90 -15
- package/dist/core/useChatAuth.d.ts +96 -0
- package/dist/core/useChatRooms.d.ts +66 -0
- package/dist/core/useKeepAlive.d.ts +41 -0
- package/dist/core/useLlm.d.ts +73 -0
- package/dist/core/useRunningGroups.d.ts +58 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +119 -108
- package/dist/mobile-ui/chat/ChatContainer.vue.d.ts +8 -8
- package/dist/mobile-ui/chat/ChatMessagesView.vue.d.ts +6 -6
- package/dist/mobile-ui/index.cjs +1 -1
- package/dist/mobile-ui/index.js +104 -104
- package/dist/mobile-ui/inputbox/Inputbox.vue.d.ts +6 -6
- package/dist/page-context/index.js +2 -4
- package/dist/parser/answerCom/actionExecute/actionProtocol.d.ts +1 -7
- package/dist/parser/answerCom/actionExecute/clarification.d.ts +15 -3
- package/dist/parser/answerCom/actionExecute/constants.d.ts +10 -0
- package/dist/parser/answerCom/actionExecute/parseCollectClarifications.d.ts +3 -2
- package/dist/parser/answerCom/actionExecute/parseHostAction.d.ts +3 -2
- package/dist/parser/answerCom/actionExecute/types.d.ts +3 -3
- package/dist/parser/answerCom/generic/parseGeneric.d.ts +52 -0
- package/dist/parser/answerCom/generic/types.d.ts +75 -0
- package/dist/parser/answerCom/outputFile/parseOutputFile.d.ts +7 -6
- package/dist/parser/answerCom/outputFile/types.d.ts +15 -5
- package/dist/parser/answerCom/presentFiles/parsePresentFiles.d.ts +58 -0
- package/dist/parser/answerCom/presentFiles/types.d.ts +27 -0
- package/dist/parser/answerMeta.d.ts +71 -0
- package/dist/parser/deepThinking/parseDeepThinking.d.ts +8 -0
- package/dist/parser/history/history.d.ts +9 -0
- package/dist/parser/history/index.d.ts +1 -1
- package/dist/parser/index.cjs +6 -2
- package/dist/parser/index.d.ts +13 -4
- package/dist/parser/index.js +640 -457
- package/dist/parser/message.d.ts +9 -0
- package/dist/parser/registry.d.ts +1 -1
- package/dist/parser/runTime.d.ts +29 -0
- package/dist/renderers/TextAnswer-BgKGvG_o.cjs +2 -0
- package/dist/renderers/TextAnswer-PQwV3K7v.js +5 -0
- package/dist/renderers/aiAnswer/AiAnswerBubble.vue.d.ts +4 -4
- package/dist/renderers/answerCard/AnswerCard.vue.d.ts +65 -0
- package/dist/renderers/answerCard/AnswerToolbar.vue.d.ts +42 -0
- package/dist/renderers/answerConfig.d.ts +33 -0
- package/dist/renderers/clarification/ClarificationCard.vue.d.ts +3 -3
- package/dist/renderers/deepThinking/DeepThinkingSteps.vue.d.ts +4 -4
- package/dist/renderers/deviceLastValue/DeviceLastValue.vue.d.ts +37 -0
- package/dist/renderers/hostAction/HostActionStatus.vue.d.ts +3 -3
- package/dist/renderers/iframePage/IframePage.vue.d.ts +3 -3
- package/dist/renderers/index.cjs +6 -1
- package/dist/renderers/index.d.ts +14 -0
- package/dist/renderers/index.js +1504 -607
- package/dist/renderers/knowledgeStream/KnowledgeStreamResult.vue.d.ts +3 -3
- package/dist/renderers/media/MediaAnswer.vue.d.ts +19 -0
- package/dist/renderers/outputFile/OutputFile.vue.d.ts +3 -3
- package/dist/renderers/outputFile/OutputFileLink.vue.d.ts +19 -0
- package/dist/renderers/outputFile/localFile.d.ts +46 -0
- package/dist/renderers/outputFile/useOutputFile.d.ts +32 -3
- package/dist/renderers/presentFiles/PresentFiles.vue.d.ts +19 -0
- package/dist/renderers/recordset/RecordsetView.vue.d.ts +19 -0
- package/dist/renderers/sqlQuery/SqlQuery.vue.d.ts +19 -0
- package/dist/renderers/style.css +1 -1
- package/dist/renderers/text/TextAnswer.vue.d.ts +19 -0
- package/dist/request/api.d.ts +121 -1
- package/dist/request/client.d.ts +6 -0
- package/dist/request/index.cjs +4 -2
- package/dist/request/index.d.ts +4 -2
- package/dist/request/index.js +754 -181
- package/dist/request/ws.d.ts +11 -86
- package/dist/request/wsCore.d.ts +104 -0
- package/dist/request/wsSession.d.ts +353 -0
- package/dist/right-panel/RightPanel.vue.d.ts +6 -6
- package/dist/right-panel/RightPanelIcon.vue.d.ts +4 -4
- package/dist/right-panel/RightPanelTabs.vue.d.ts +9 -5
- package/dist/right-panel/index.cjs +1 -1
- package/dist/right-panel/index.d.ts +1 -1
- package/dist/right-panel/index.js +617 -537
- package/dist/right-panel/panels/newtab/NewTabPanel.vue.d.ts +4 -4
- package/dist/right-panel/panels/web/WebPanel.vue.d.ts +3 -3
- package/dist/right-panel/shared/BrowserToolbar.vue.d.ts +3 -3
- package/dist/right-panel/shared/RightPanelToolList.vue.d.ts +5 -5
- package/dist/right-panel/style.css +1 -1
- package/dist/right-panel/types.d.ts +10 -0
- package/dist/theme/index.js +2 -4
- package/dist/tools/index.cjs +5 -5
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js +323 -217
- package/dist/tools/markdown/MarkdownContent.vue.d.ts +5 -5
- package/dist/tools/markdown/index.d.ts +2 -0
- package/dist/tools/markdown/interactions.d.ts +39 -0
- package/dist/tools/markdown/sanitize.d.ts +6 -0
- package/dist/tools/style.css +1 -1
- package/dist/tools/useAutoScroll.d.ts +3 -3
- package/dist/web-ui/attach/AttachmentCard.vue.d.ts +6 -6
- package/dist/web-ui/attach/AttachmentList.vue.d.ts +6 -6
- package/dist/web-ui/chat/ChatContainer.vue.d.ts +10 -10
- package/dist/web-ui/chat/ChatMessagesView.vue.d.ts +6 -6
- package/dist/web-ui/envswitch/EnvSwitch.vue.d.ts +6 -6
- package/dist/web-ui/index.cjs +1 -1
- package/dist/web-ui/index.js +630 -635
- package/dist/web-ui/inputbox/Inputbox.vue.d.ts +11 -11
- package/dist/web-ui/recordset/RecordsetTable.vue.d.ts +4 -4
- package/dist/web-ui/style.css +1 -1
- package/package.json +2 -1
package/dist/core/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),p=require("wi-chat/parser"),X=require("wi-chat/request"),ne=e=>{const w=e.login,b=e.defaultGroupTitle??"新对话",A=e.lastCount??10,i=e.autoSetGroupTitleOnFirstQuestion??!0,m={beforeKnowledgeRender:e.beforeKnowledgeRender,parsers:e.parsers,actionExecute:{...e.actionExecute,reply:s=>ee(s)}},v=l.ref(""),o=l.ref([]),I=l.ref(""),q=l.ref(e.incPrevQuestion??"Y"),r=l.ref(!1),c=l.ref(!1),t=l.ref(""),u=l.ref(!1),L=l.ref(""),d=l.ref(!0),y=l.ref(!1),x=l.ref(0),D=e.api?null:X.createRequest({baseURL:e.baseURL??"",getWisession:()=>v.value}),T=e.api??X.createChatApi(D);let C=null,M=null,H=0,S=0,V=0,B=null,P=[];const a=async()=>{if(L.value="",!D||!w){u.value=!0;return}try{const s=await X.login(D,w);return v.value=s.wisession||"",u.value=!0,s}catch(s){throw L.value=s instanceof Error?s.message:String(s),s}},n=s=>s===H,R=s=>{typeof URL>"u"||typeof URL.revokeObjectURL!="function"||s.forEach(G=>{G.role!=="user"||!G.attachments||G.attachments.forEach(h=>{var _;const E=(_=h.attachContent)==null?void 0:_.url;E&&E.startsWith("blob:")&&URL.revokeObjectURL(E)})})},F=async s=>{const G=++S;V+=1,r.value=!0,R(o.value),p.clearPendingClarifications(),o.value=[],t.value=s,d.value=!0,y.value=!1,x.value=0;const h=[],E=()=>{const g=[];h.forEach(O=>{g.push(O.user),O.assistant&&g.push(O.assistant)}),G===S&&(o.value=g)},_=g=>{G===S&&(g.type==="users"?(h.length=0,g.users.forEach(O=>h.push({user:O}))):h[g.index]&&(g.user&&(h[g.index].user=g.user),h[g.index].assistant=g.assistant),E())};try{await p.loadGroupMessagesByStep(T,s,A,_,0,m),E(),G===S&&(x.value=h.length,h.length<A&&(d.value=!1))}finally{V-=1,V<=0&&(V=0,r.value=!1)}},Y=async()=>{if(!t.value||r.value||!d.value||y.value)return;const s=t.value,G=S,h=x.value;y.value=!0;try{const E=await p.loadGroupMessagesByStep(T,s,A,void 0,h,m),_=E.filter(g=>g.role==="user").length;if(_<A&&(d.value=!1),G===S&&t.value===s){const g=new Set;o.value.forEach(Q=>{Q.historyId&&g.add(Q.historyId),Q.id&&g.add(Q.id)});const O=E.filter(Q=>!(Q.historyId&&g.has(Q.historyId)||Q.id&&g.has(Q.id)));o.value=[...O,...o.value],x.value+=_}}finally{y.value=!1}},ie=async(s=b)=>{const G=await p.createHistoryGroup(T,s);return t.value=G,G},$=()=>{H+=1,S+=1,M&&(M.stopped=!0,M.thinking.expanded=!1),C==null||C.abort(),C=null,B=null,P=[],p.clearPendingClarifications(),M=null,c.value=!1},oe=()=>{M&&(M.error=!0,M.thinking.expanded=!1)},ce=async s=>{var ae,se;const G=typeof s=="string"?{text:s}:s||{},{text:h,entryId:E,files:_,attachments:g,extArgs:O,...Q}=G,j=(h!==void 0?h:I.value).trim(),de=O??e.extArgs??{},ge=_&&_.length>0?_:(g??[]).map(k=>{var z;return(z=k.attachContent)==null?void 0:z.raw}).filter(k=>!!k);if(!j||c.value||!t.value)return;const K=H+1;H=K,S+=1;let te=!1;try{c.value=!0;const k=t.value,z=g||(_||[]).map(f=>{var W;const J=f.name.includes(".")&&((W=f.name.split(".").pop())==null?void 0:W.toLowerCase())||"";return{type:"file",name:f.name,description:J?J.toUpperCase():"",attachContent:{file_name:f.name,size:f.size,suffix:J,raw:f}}}),ve=x.value===0&&!o.value.some(f=>f.role==="user"),Z=k,re=l.reactive({id:p.nextLocalMessageId("user"),role:"user",content:j,attachments:z.length>0?z:void 0});o.value.push(re);const U=l.reactive({id:p.nextLocalMessageId("answer"),role:"assistant",answer:p.createEmptyAnswerValues("",j),error:!1,stopped:!1,thinking:{steps:[],expanded:!0}});if(M=U,o.value.push(U),I.value="",(ae=e.onSubmitQuestion)==null||ae.call(e,j),ve&&Z){const f=p.buildChatTitle(j);e.onFirstQuestion?e.onFirstQuestion({question:f,groupId:Z}):i&&f&&T.setHistoryGroupTitle(Z,f).catch(()=>{})}C=new AbortController;const ye=await T.questionStream({...Q,question:j,historyGroupId:k,entryId:E,files:ge,ext_args:JSON.stringify(de),incPrevQuestion:q.value,onOpen:f=>{if(!n(K))return;B=f;const J=P;P=[],J.forEach(({payloadText:W,chunkSize:N})=>f(W,N))}},C.signal);x.value+=1,await p.consumeStream(ye,f=>{var W;if(!n(K))return;if(f.mode==="history_id"){const N=typeof f.value=="object"&&f.value!==null?f.value.history_id:f.value;N&&(re.historyId=String(N),U.historyId=String(N),U.answer&&(U.answer.id=String(N)))}p.applyAnswerChunk(U.answer,f,m).includes("deep_thinking")&&(U.thinking.steps=p.collectThinkingSteps(U.answer)),f.mode==="finish"&&(U.thinking.expanded=!1),(W=e.onChunk)==null||W.call(e,f)}),n(K)&&(U.thinking.expanded=!1),n(K)&&(te=!0)}catch(k){n(K)&&!X.isCancelError(k)&&oe()}finally{n(K)&&(c.value=!1,C=null,M=null,B=null,P=[])}te&&((se=e.onFinish)==null||se.call(e))},ee=(s,G)=>{if(!c.value)return!1;const h=typeof s=="string"?s:JSON.stringify(s)??"";return B?B(h,G):P.push({payloadText:h,chunkSize:G}),!0},fe=e.autoLogin!==!1?a().then(()=>{}).catch(()=>{}):Promise.resolve();return l.getCurrentInstance()&&l.onBeforeUnmount(()=>{$(),R(o.value)}),{messages:o,question:I,incPrevQuestion:q,talking:c,loading:r,session:v,autoLoginDone:u,autoLoginError:L,loginDone:fe,historyGroupId:t,selfRequest:D,api:T,doAutoLogin:a,loadGroup:F,loadOlder:Y,hasMore:d,loadMoreLoading:y,createGroup:ie,submitQuestion:ce,sendWsMessage:ee,stopQuestion:$}},he="wi-chat-history-groups",le=e=>{var P;const{api:w,defaultGroupTitle:b="新对话",lastCount:A=10,ensureGroup:i=!0,autoSelectFirst:m=!0,autoLoadMessages:v=!0}=e,o=e.persistGroups??!1,I=e.storageKey??he,q=e.beforeKnowledgeRender||(P=e.parsers)!=null&&P.length?{beforeKnowledgeRender:e.beforeKnowledgeRender,parsers:e.parsers}:void 0,r=l.ref([]),c=l.ref(""),t=l.ref([]),u=l.ref(!1);let L=!1,d=null;const y=()=>{if(d===!1)return null;let a;try{a=localStorage.getItem(I)}catch{return d=!1,null}if(a===null)return[];try{const n=JSON.parse(a);return Array.isArray(n)?n:[]}catch{return[]}},x=a=>{if(d!==!1)try{localStorage.setItem(I,JSON.stringify(a))}catch{d=!1}},D=a=>{const n=y();n!==null&&x([...n,a])},T=async(a,n=A)=>{u.value=!0;try{t.value=a?await p.loadGroupMessages(w,a,n,0,q):[]}finally{u.value=!1}},C=async a=>{c.value=a,v&&await T(a)},M=async()=>{if(!L){L=!0;try{r.value.length===0?i&&await S(b):!c.value&&m&&await C(r.value[0].group_id)}finally{L=!1}}},H=async()=>{u.value=!0;try{const a=await p.getHistoryGroups(w);if(o){const n=y();if(n===null)r.value=a;else{const R=new Set(n.map(Y=>Y.group_id)),F=a.filter(Y=>R.has(Y.group_id));x(F),r.value=F}}else r.value=a;await M()}finally{u.value=!1}},S=async(a=b)=>{const n=await p.createHistoryGroup(w,a);return o&&D({group_id:n,group_title:a}),await H(),c.value!==n&&await C(n),n};return{groups:r,activeGroupId:c,messages:t,loading:u,loadGroups:H,createGroup:S,renameGroup:async(a,n)=>{await p.setHistoryGroupTitle(w,a,n);const R=r.value.find(F=>F.group_id===a);R&&(R.group_title=n),o&&x(r.value)},deleteGroup:async a=>{const n=r.value.findIndex(F=>F.group_id===a);if(await p.deleteHistoryGroup(w,a),r.value=r.value.filter(F=>F.group_id!==a),o&&x(r.value),c.value!==a)return;const R=r.value[n]??r.value[r.value.length-1];if(R){await C(R.group_id);return}i?await S(b):(c.value="",t.value=[])},selectGroup:C,loadMessages:T}},ue=e=>{const{api:w,defaultEntryId:b,entryGroup:A="智能助手",autoLoad:i=!0}=e,m=l.ref([]),v=l.ref(null),o=l.ref(!1),I=c=>c?typeof w.getFileUrl=="function"?w.getFileUrl(c):p.resolveRemoteFileUrl(c,"","/algorithm/get_file_data"):"",q=c=>{v.value=c},r=async()=>{var c;o.value=!0;try{let t=b||((c=v.value)==null?void 0:c.entry_id);if(!t)try{const y=await w.getDefaultLlmId();t=y==null?void 0:y.default_entry_id}catch(y){console.warn("[useAgent] 获取默认智能体 ID 失败:",y)}const u=await w.getLlmEntryListByRole({entry_group:A}),d=((u==null?void 0:u.values)||[]).filter(y=>y.entry_enable!==!1);if(m.value=d,t){const y=d.find(x=>x.entry_id===t);y?v.value=y:d.length>0&&(v.value=d[0])}else d.length>0&&!v.value&&(v.value=d[0])}finally{o.value=!1}};return i&&(l.getCurrentInstance()?l.onMounted(()=>{r()}):r()),{agentList:m,currentAgent:v,loading:o,getFileUrl:I,loadAgents:r,selectAgent:q}},pe=(e={})=>{const w=e.parsers??[];let b=null,A;const i=ne({...e.chat,parsers:w,onFirstQuestion:({question:t,groupId:u})=>{A==null||A(u,t)}}),m=le({...e.history,api:i.api,autoLoadMessages:!1,parsers:w});A=(t,u)=>{b=m.renameGroup(t,u).catch(L=>{var d;(d=e.onError)==null||d.call(e,L,"groups")})};const v=ue({...e.agent,api:i.api,autoLoad:!1}),o=(t,u)=>{var L;(L=e.onError)==null||L.call(e,t,u)},I=async()=>{try{await m.loadGroups()}catch(t){o(t,"groups")}},q=async t=>{try{await i.loadGroup(t)}catch(u){o(u,"messages")}},r=async()=>{try{await v.loadAgents()}catch(t){o(t,"agents")}},c=async t=>{var d;const u=typeof t=="string"?{text:t}:t;await i.submitQuestion({...u,entryId:(u==null?void 0:u.entryId)??((d=v.currentAgent.value)==null?void 0:d.entry_id)});const L=b;b=null,L&&await L,await I()};return l.watch(i.session,t=>{t&&(I(),r())}),l.watch(m.activeGroupId,t=>{t&&q(t)}),{chat:i,history:m,agent:v,parsers:w,messages:i.messages,question:i.question,incPrevQuestion:i.incPrevQuestion,talking:i.talking,loading:i.loading,session:i.session,groups:m.groups,activeGroupId:m.activeGroupId,historyLoading:m.loading,agentList:v.agentList,currentAgent:v.currentAgent,agentLoading:v.loading,hasMore:i.hasMore,loadMoreLoading:i.loadMoreLoading,loadGroup:q,loadOlder:i.loadOlder,refreshGroups:I,loadAgents:r,selectAgent:v.selectAgent,getFileUrl:v.getFileUrl,submitQuestion:c,sendWsMessage:i.sendWsMessage,stopQuestion:i.stopQuestion}};exports.useAgent=ue;exports.useChat=ne;exports.useChatSession=pe;exports.useHistory=le;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("vue"),C=require("wi-chat/parser"),H=require("wi-chat/request"),ce=e=>{const{api:n,interval:h=5*60*1e3,renew:d,onExpired:l,immediate:w=!0}=e,c=f.ref(!1),o=f.ref(0);let L=null,x=null;const m=async()=>{const v=d?await d().catch(()=>!1):!1;return v||l==null||l(),v},i=()=>x||(x=(async()=>{if(!n.pingLogin)return!0;try{const v=await n.pingLogin();return o.value=Date.now(),(v==null?void 0:v.is_login)===!1?m():!0}catch(v){return v instanceof H.AuthExpiredError?m():!0}finally{x=null}})(),x),t=()=>{L||(c.value=!0,L=setInterval(()=>void i(),h))},s=()=>{L&&clearInterval(L),L=null,c.value=!1};return w&&t(),f.getCurrentInstance()&&f.onBeforeUnmount(s),{active:c,lastPingAt:o,start:t,stop:s,pingNow:i}},k={get(e){try{return typeof localStorage<"u"?localStorage.getItem(e):null}catch{return null}},set(e,n){try{typeof localStorage<"u"&&localStorage.setItem(e,n)}catch{}},remove(e){try{typeof localStorage<"u"&&localStorage.removeItem(e)}catch{}}},Re=e=>btoa(unescape(encodeURIComponent(e))),Ge=e=>decodeURIComponent(escape(atob(e))),Z=e=>{let n=null;return()=>(n||(n=Promise.resolve().then(e).catch(()=>!1).finally(()=>{setTimeout(()=>n=null,0)})),n)},fe=e=>({get(){const n=k.get(e);if(!n)return null;try{const h=JSON.parse(Ge(n));return h!=null&&h.user&&(h!=null&&h.pass)?h:null}catch{return null}},set(n){k.set(e,Re(JSON.stringify(n)))},clear(){k.remove(e)}}),Ee=e=>{const n=e.sessionKey===void 0?"wi-chat-session":e.sessionKey,h=e.remember??!1;let d=null;const l=e.credentialStore??(h&&n?fe(`${n}-account`):{get:()=>d,set:_=>{d=_},clear:()=>{d=null}}),w=n?`${n}-user`:null,c=f.ref(n?k.get(n)??"":""),o=f.ref(null);if(w)try{o.value=JSON.parse(k.get(w)||"null")}catch{o.value=null}const L=f.computed(()=>!!c.value),x=_=>{c.value=_.wisession||"",o.value=_,n&&k.set(n,c.value),w&&k.set(w,JSON.stringify(_))},m=()=>{c.value="",o.value=null,n&&k.remove(n),w&&k.remove(w)},i=H.createRequest({baseURL:e.baseURL});let t=0;const s=Z(async()=>{const _=t;try{const T=await l.get();if(!T)return!1;const O=await H.login(i,{...T,client:e.client});return _!==t?!1:(x(O),!0)}catch{return!1}}),v=H.createRequest({baseURL:e.baseURL,getWisession:()=>c.value,onAuthExpired:async()=>{const _=await s();return _||g(),_}}),a=H.createChatApi(v,{resumable:e.resumable??!0,refreshSession:async()=>{const _=await s();return _||g(),_}}),u=ce({api:a,interval:e.pingInterval||5*60*1e3,renew:async()=>c.value?s():!1,onExpired:()=>g(),immediate:!1}),g=()=>{var _;c.value&&(m(),u.stop(),(_=e.onExpired)==null||_.call(e))},R=()=>{e.pingInterval!==0&&u.start()},I=async(_,T,O={})=>{const W={...O,user:_,pass:T,client:e.client},K=await H.login(i,W);return x(K),await l.set({user:_,pass:T}),R(),K},M=async()=>{const _=await s();return _&&R(),_},Q=async(_=!0)=>{t+=1,m(),u.stop(),_&&await l.clear()};return c.value&&(R(),u.pingNow()),{session:c,userInfo:o,isLoggedIn:L,request:v,api:a,keepAlive:u,login:I,autoLogin:M,renew:s,logout:Q}},Ie=e=>{const n={requestId:e,sender:null,queue:[],closed:!1,reply:h=>de(n,h)};return n},de=(e,n,h)=>{if(e.closed)return!1;const d=typeof n=="string"?n:JSON.stringify(n)??"";return e.sender?e.sender(d,h)!==!1:(e.queue.push({payloadText:d,chunkSize:h}),!0)},ie=e=>{e.closed||(e.closed=!0,e.queue.length=0,e.sender=null,C.expirePendingClarificationsForReply(e.reply))},ee=e=>{const n=e.login,h=e.defaultGroupTitle??"新对话",d=e.lastCount??10,l=e.autoSetGroupTitleOnFirstQuestion??!0,w={beforeKnowledgeRender:e.beforeKnowledgeRender,parsers:e.parsers,actionExecute:{...e.actionExecute,reply:()=>!1}},c=f.ref(""),o=f.ref([]),L=f.ref(""),x=f.ref(e.incPrevQuestion??"Y"),m=f.ref(!1),i=f.ref(!1),t=f.ref(""),s=f.ref(!1),v=f.ref(""),a=f.ref(!0),u=f.ref(!1),g=f.ref(0),R=e.api?null:H.createRequest({baseURL:e.baseURL??"",getWisession:()=>c.value,onAuthExpired:()=>Q()}),I=e.api??H.createChatApi(R,{resumable:e.resumable,refreshSession:()=>Q()}),M=R?H.createRequest({baseURL:e.baseURL??""}):null,Q=Z(async()=>{if(e.onAuthExpired)return e.onAuthExpired();if(!R||!n||!M)return!1;const r=await H.login(M,n);return c.value=r.wisession||"",!!c.value}),_=(r,b)=>{var p;r&&((p=e.onRunningChange)==null||p.call(e,r,b))};let T=null,O=null,W=0,K=0,S=0,A=null;const N=async()=>{if(v.value="",!R||!n){s.value=!0;return}try{const r=await H.login(M??R,n);return c.value=r.wisession||"",s.value=!0,r}catch(r){throw v.value=r instanceof Error?r.message:String(r),r}},P=r=>r===W,V=r=>{typeof URL>"u"||typeof URL.revokeObjectURL!="function"||r.forEach(b=>{b.role!=="user"||!b.attachments||b.attachments.forEach(p=>{var G;const q=(G=p.attachContent)==null?void 0:G.url;q&&q.startsWith("blob:")&&URL.revokeObjectURL(q)})})},he=r=>({beforeKnowledgeRender:e.beforeKnowledgeRender,parsers:e.parsers,actionExecute:{...e.actionExecute,reply:r.reply}}),we=async r=>{const b=++K;S+=1,m.value=!0,V(o.value),A&&C.clearPendingClarifications(A.reply),o.value=[],t.value=r,a.value=!0,u.value=!1,g.value=0;const p=[],q=()=>{const y=[];p.forEach(F=>{y.push(F.user),F.assistant&&y.push(F.assistant)}),b===K&&(o.value=y)},G=y=>{b===K&&(y.type==="users"?(p.length=0,y.users.forEach(F=>p.push({user:F}))):p[y.index]&&(y.user&&(p[y.index].user=y.user),p[y.index].assistant=y.assistant),q())};try{await C.loadGroupMessagesByStep(I,r,d,G,0,w),q(),b===K&&(g.value=p.length,p.length<d&&(a.value=!1))}finally{S-=1,S<=0&&(S=0,m.value=!1)}},pe=async()=>{if(!t.value||m.value||!a.value||u.value)return;const r=t.value,b=K,p=g.value;u.value=!0;try{const q=await C.loadGroupMessagesByStep(I,r,d,void 0,p,w),G=q.filter(y=>y.role==="user").length;if(G<d&&(a.value=!1),b===K&&t.value===r){const y=new Set;o.value.forEach(E=>{E.historyId&&y.add(E.historyId),E.id&&y.add(E.id)});const F=q.filter(E=>!(E.historyId&&y.has(E.historyId)||E.id&&y.has(E.id)));o.value=[...F,...o.value],g.value+=G}}finally{u.value=!1}},me=async(r=h)=>{const b=await C.createHistoryGroup(I,r);return t.value=b,b},te=(r=!0)=>{var b;r!==!1&&i.value&&t.value&&((b=I.stopChat)==null||b.call(I,t.value)),W+=1,K+=1,O&&(O.stopped=!0,O.thinking.expanded=!1,Y(O)),T==null||T.abort(),T=null,A&&ie(A),A=null,O=null,i.value=!1},Se=()=>{O&&(O.error=!0,O.thinking.expanded=!1,Y(O))},re=async(r,b,p,q)=>{const G=W+1;W=G,K+=1;const y=Ie(G);A=y;const F=he(y),E=q||t.value;O=r,i.value=!0,_(E,!0);let D=!1;try{T=new AbortController;const z=await p(B=>{if(!P(G)||y.closed)return;y.sender=B;const J=y.queue;y.queue=[],J.forEach(({payloadText:$,chunkSize:X})=>B($,X))},T.signal);await C.consumeStream(z,B=>{var J;P(G)&&(Ae(r,b,B,F),(J=e.onChunk)==null||J.call(e,B))}),P(G)&&(D=!0,r.thinking.expanded=!1,Y(r))}catch(z){P(G)&&!H.isCancelError(z)&&Se()}finally{ie(y),A===y&&(A=null),_(E,!1),P(G)&&(i.value=!1,T=null,O=null)}return D&&_e(r),D},Ae=(r,b,p,q)=>{if(p.mode==="history_id"){const y=typeof p.value=="object"&&p.value!==null?p.value.history_id:p.value;y&&(b&&(b.historyId=String(y)),r.historyId=String(y),r.answer.id=String(y));return}if(p.mode==="start"){const y=C.parseServerStartTime(p.value??p.time,r.runStartAt);y!=null&&r.runStartAt!=null&&(r.runStartAt=y);return}if(p.mode==="history_answer"){const y=C.normalizeAnswer(p.value,r.historyId??"",r.answer.question??"",w);r.answer=y,r.thinking.steps=C.collectThinkingSteps(y);return}C.applyAnswerChunk(r.answer,p,q).includes("deep_thinking")&&(r.thinking.steps=C.collectThinkingSteps(r.answer)),p.mode==="finish"&&(r.thinking.expanded=!1)},Y=r=>{!r||r.runStartAt==null||(r.runMs=Math.max(0,Date.now()-r.runStartAt),delete r.runStartAt)},_e=async r=>{if(!(!e.syncMetaOnFinish||!r.historyId))try{const b=await I.getHistoryAnswer(r.historyId);C.mergeAnswerMeta(r.answer,b);const p=C.readAnswerMeta(r.answer).runMs;p!=null&&(r.runMs=p)}catch{}},be=async r=>{var se,le;const b=typeof r=="string"?{text:r}:r||{},{text:p,entryId:q,files:G,attachments:y,extArgs:F,...E}=b,D=(p!==void 0?p:L.value).trim(),z=F??e.extArgs??{},B=G&&G.length>0?G:(y??[]).map(U=>{var j;return(j=U.attachContent)==null?void 0:j.raw}).filter(U=>!!U);if(!D||i.value||!t.value)return;const J=t.value,$=y||(G||[]).map(U=>{var oe;const j=U.name.includes(".")&&((oe=U.name.split(".").pop())==null?void 0:oe.toLowerCase())||"";return{type:"file",name:U.name,description:j?j.toUpperCase():"",attachContent:{file_name:U.name,size:U.size,suffix:j,raw:U}}}),X=g.value===0&&!o.value.some(U=>U.role==="user"),ne=f.reactive({id:C.nextLocalMessageId("user"),role:"user",content:D,attachments:$.length>0?$:void 0});o.value.push(ne);const ae=f.reactive({id:C.nextLocalMessageId("answer"),role:"assistant",answer:C.createEmptyAnswerValues("",D),error:!1,stopped:!1,runStartAt:Date.now(),thinking:{steps:[],expanded:!0}});if(o.value.push(ae),L.value="",(se=e.onSubmitQuestion)==null||se.call(e,D),X){const U=C.buildChatTitle(D);e.onFirstQuestion?e.onFirstQuestion({question:U,groupId:J}):l&&U&&I.setHistoryGroupTitle(J,U).catch(()=>{})}g.value+=1,await re(ae,ne,(U,j)=>I.questionStream({...E,question:D,historyGroupId:J,entryId:q,files:B,ext_args:JSON.stringify(z),incPrevQuestion:x.value,onOpen:U},j))&&((le=e.onFinish)==null||le.call(e))},Le=async r=>{var F;if(i.value||!(r!=null&&r.history_id)||t.value&&r.history_group_id&&r.history_group_id!==t.value)return!1;!t.value&&r.history_group_id&&(t.value=r.history_group_id);const b=o.value.find(E=>E.role==="user"&&E.historyId===r.history_id);o.value=o.value.filter(E=>!(E.role==="assistant"&&E.historyId===r.history_id));let p=b??null;p||(p=f.reactive({id:r.history_id,historyId:r.history_id,role:"user",content:r.question??""}),o.value.push(p),g.value+=1);const q=f.reactive({id:`${r.history_id}-answer`,historyId:r.history_id,role:"assistant",answer:C.createEmptyAnswerValues(r.history_id,r.question??""),error:!1,stopped:!1,runStartAt:Date.now(),thinking:{steps:[],expanded:!0}}),G=o.value.indexOf(p);o.value.splice(G+1,0,q);const y=await re(q,p,(E,D)=>I.questionStream({question:r.question??"",historyGroupId:r.history_group_id||t.value,resumeTask:r,onOpen:E},D),r.history_group_id||t.value);return y&&((F=e.onFinish)==null||F.call(e)),y},Ce=(r,b)=>!i.value||!A?!1:de(A,r,b),xe=e.autoLogin!==!1?N().then(()=>{}).catch(()=>{}):Promise.resolve();return f.getCurrentScope()&&f.onScopeDispose(()=>{te(!1),V(o.value)}),{messages:o,question:L,incPrevQuestion:x,talking:i,loading:m,session:c,autoLoginDone:s,autoLoginError:v,loginDone:xe,historyGroupId:t,selfRequest:R,api:I,doAutoLogin:N,loadGroup:we,loadOlder:pe,hasMore:a,loadMoreLoading:u,createGroup:me,submitQuestion:be,sendWsMessage:Ce,stopQuestion:te,resumeTask:Le,renewSession:Q}},Me="wi-chat-history-groups",ve=e=>{var K;const{api:n,defaultGroupTitle:h="新对话",lastCount:d=10,ensureGroup:l=!0,autoSelectFirst:w=!0,autoLoadMessages:c=!0}=e,o=e.persistGroups??!1,L=e.storageKey??Me,x=e.beforeKnowledgeRender||(K=e.parsers)!=null&&K.length?{beforeKnowledgeRender:e.beforeKnowledgeRender,parsers:e.parsers}:void 0,m=f.ref([]),i=f.ref(""),t=f.ref([]),s=f.ref(!1);let v=!1,a=null;const u=()=>{if(a===!1)return null;let S;try{S=localStorage.getItem(L)}catch{return a=!1,null}if(S===null)return[];try{const A=JSON.parse(S);return Array.isArray(A)?A:[]}catch{return[]}},g=S=>{if(a!==!1)try{localStorage.setItem(L,JSON.stringify(S))}catch{a=!1}},R=S=>{const A=u();A!==null&&g([...A,S])},I=async(S,A=d)=>{s.value=!0;try{t.value=S?await C.loadGroupMessages(n,S,A,0,x):[]}finally{s.value=!1}},M=async S=>{i.value=S,c&&await I(S)},Q=async()=>{if(!v){v=!0;try{m.value.length===0?l&&await T(h):!i.value&&w&&await M(m.value[0].group_id)}finally{v=!1}}},_=async()=>{s.value=!0;try{const S=await C.getHistoryGroups(n);if(o){const A=u();if(A===null)m.value=S;else{const N=new Set(A.map(V=>V.group_id)),P=S.filter(V=>N.has(V.group_id));g(P),m.value=P}}else m.value=S;await Q()}finally{s.value=!1}},T=async(S=h)=>{const A=await C.createHistoryGroup(n,S);return o&&R({group_id:A,group_title:S}),await _(),i.value!==A&&await M(A),A};return{groups:m,activeGroupId:i,messages:t,loading:s,loadGroups:_,createGroup:T,renameGroup:async(S,A)=>{await C.setHistoryGroupTitle(n,S,A);const N=m.value.find(P=>P.group_id===S);N&&(N.group_title=A),o&&g(m.value)},deleteGroup:async S=>{const A=m.value.findIndex(P=>P.group_id===S);if(await C.deleteHistoryGroup(n,S),m.value=m.value.filter(P=>P.group_id!==S),o&&g(m.value),i.value!==S)return;const N=m.value[A]??m.value[m.value.length-1];if(N){await M(N.group_id);return}l?await T(h):(i.value="",t.value=[])},selectGroup:M,loadMessages:I}},ye=e=>{const{api:n,defaultEntryId:h,entryGroup:d="智能助手",autoLoad:l=!0}=e,w=f.ref([]),c=f.ref(null),o=f.ref(!1),L=i=>i?typeof n.getFileUrl=="function"?n.getFileUrl(i):C.resolveRemoteFileUrl(i,"","/algorithm/get_file_data"):"",x=i=>{c.value=i},m=async()=>{var i;o.value=!0;try{let t=h||((i=c.value)==null?void 0:i.entry_id);if(!t)try{const u=await n.getDefaultLlmId();t=u==null?void 0:u.default_entry_id}catch(u){console.warn("[useAgent] 获取默认智能体 ID 失败:",u)}const s=await n.getLlmEntryListByRole({entry_group:d}),a=((s==null?void 0:s.values)||[]).filter(u=>u.entry_enable!==!1);if(w.value=a,t){const u=a.find(g=>g.entry_id===t);u?c.value=u:a.length>0&&(c.value=a[0])}else a.length>0&&!c.value&&(c.value=a[0])}finally{o.value=!1}};return l&&(f.getCurrentInstance()?f.onMounted(()=>{m()}):m()),{agentList:w,currentAgent:c,loading:o,getFileUrl:L,loadAgents:m,selectAgent:x}},ge=e=>{const{api:n,interval:h=5e3,immediate:d=!1}=e,l=f.ref([]),w=f.ref(new Set);let c=null,o=null;const L=f.computed(()=>{const a=new Set(w.value);return l.value.forEach(u=>u.history_group&&a.add(String(u.history_group))),a}),x=a=>!!a&&L.value.has(a),m=(a,u)=>{if(!a)return;const g=new Set(w.value);if(u?g.add(a):g.delete(a),w.value=g,!u){const R=o;(async()=>(R&&await R,await t()))()}},i=a=>l.value.find(u=>String(u.history_group)===a&&u.is_connected!==!0&&!w.value.has(a)),t=()=>o||(o=(async()=>{if(!n.getChatTaskList)return l.value;try{const a=(await n.getChatTaskList()).filter(u=>u&&u.is_stop!==!0);if(l.value=a,e.onUnknownGroups&&e.isKnownGroup){const u=a.map(g=>String(g.history_group)).filter(g=>g&&!e.isKnownGroup(g));u.length&&e.onUnknownGroups(u)}}catch{}finally{o=null}return l.value})(),o),s=()=>{c||!h||(t(),c=setInterval(()=>void t(),h))},v=()=>{c&&clearInterval(c),c=null,l.value=[]};return d&&s(),f.getCurrentInstance()&&f.onBeforeUnmount(v),{tasks:l,runningIds:L,isRunning:x,setLocalRunning:m,findResumableTask:i,refresh:t,start:s,stop:v}},qe=e=>{const{api:n,maxRooms:h=10}=e,d=f.shallowReactive(new Map),l=f.ref(""),w=ge({api:n,interval:e.taskPollInterval??5e3,onUnknownGroups:e.onUnknownGroups,isKnownGroup:e.isKnownGroup}),c=t=>{if(d.size<=h)return;const s=[...d.entries()].filter(([v,a])=>v!==l.value&&v!==t&&!a.chat.talking.value).sort((v,a)=>v[1].touchedAt-a[1].touchedAt);for(;d.size>h&&s.length;){const[v]=s.shift();x(v)}},o=t=>{const s=d.get(t);if(s)return s.touchedAt=Date.now(),s.chat;const v=f.effectScope(!0),a=v.run(()=>{var g;return ee({...(g=e.roomOptions)==null?void 0:g.call(e,t),api:n,autoLogin:!1,parsers:e.parsers,beforeKnowledgeRender:e.beforeKnowledgeRender,actionExecute:e.actionExecute,lastCount:e.lastCount,syncMetaOnFinish:!0,onRunningChange:w.setLocalRunning})}),u={chat:a,scope:v,loaded:a.loadGroup(t).catch(()=>{}),touchedAt:Date.now()};return d.set(t,u),c(t),a},L=async t=>{var a;if(l.value=t,!t)return;const s=o(t);if(await((a=d.get(t))==null?void 0:a.loaded),s.talking.value)return;await w.refresh();const v=w.findResumableTask(t);v&&l.value===t&&s.resumeTask({history_id:v.history_id,history_group_id:String(v.history_group),question:v.question})},x=t=>{const s=d.get(t);s&&(s.chat.stopQuestion(!1),s.scope.stop(),d.delete(t),l.value===t&&(l.value=""))},m=()=>{[...d.keys()].forEach(x),w.stop()},i=f.computed(()=>{var t;return l.value?((t=d.get(l.value))==null?void 0:t.chat)??null:null});return f.getCurrentScope()&&f.onScopeDispose(m),{activeId:l,active:i,running:w,getRoom:o,open:L,dispose:x,disposeAll:m}},Ue=e=>{if(!e||typeof localStorage>"u")return{};try{const n=JSON.parse(localStorage.getItem(e)||"{}");return n&&typeof n=="object"?n:{}}catch{return{}}},Te=(e,n)=>{if(!(!e||typeof localStorage>"u"))try{localStorage.setItem(e,JSON.stringify(n))}catch{}},Oe=e=>{const n=e.storageKey===void 0?"wi-chat-room-llm":e.storageKey,h=f.ref([]),d=f.ref(!1),l=f.ref(Ue(n)),w=f.computed(()=>new Set(h.value.flatMap(a=>(a.children??[]).map(u=>u.id)))),c=a=>{l.value=a,Te(n,a)};let o=null;const L=()=>d.value?Promise.resolve():o||(o=(async()=>{var a,u;try{const g=await((u=(a=e.api).getLlmInfoList)==null?void 0:u.call(a));if(!g)return;const R=g.connections??[];h.value=(g.factorys??[]).map(M=>({id:M.factory_id,name:M.factory_title,type:"factory",children:R.filter(Q=>Q.factory_id===M.factory_id).map(Q=>({id:Q.connect_id,name:Q.connect_title,type:"connection"}))})).filter(M=>M.children.length>0),d.value=!0;const I=Object.entries(l.value).filter(([,M])=>w.value.has(M));I.length!==Object.keys(l.value).length&&c(Object.fromEntries(I))}catch{}finally{o=null}})(),o),x=a=>!!a&&(!d.value||w.value.has(a));return{llmTree:h,loaded:d,roomLlmMap:l,validIds:w,load:L,resolve:(a,u)=>{const g=a?l.value[a]:"";return g&&x(g)?g:u||""},select:(a,u,g)=>{if(!a)return;const R={...l.value};u&&u!==g?R[a]=u:delete R[a],c(R)},migrate:(a,u)=>{const g=l.value[a];if(!g||a===u)return;const R={...l.value,[u]:g};delete R[a],c(R)},nameOf:a=>{var u;if(!a)return"";for(const g of h.value){const R=(u=g.children)==null?void 0:u.find(I=>I.id===a);if(R)return R.name}return""},isUnavailable:a=>!!a&&d.value&&!w.value.has(a)}},ue=async e=>{var d;if(typeof navigator<"u"&&((d=navigator.clipboard)!=null&&d.writeText))try{await navigator.clipboard.writeText(e);return}catch{}if(typeof document>"u")throw new Error("当前环境不支持剪贴板");const n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select();const h=document.execCommand("copy");if(document.body.removeChild(n),!h)throw new Error("复制失败")},Ke=e=>{const{api:n,buildShareUrl:h,shareDays:d=1}=e,l=i=>!!C.collectAnswerMarkdown(i.answer),w=async(i,t=!1)=>{const s=C.collectAnswerMarkdown(i.answer);if(!s)return!1;try{return await ue(t?s:C.markdownToPlainText(s)),!0}catch{return!1}},c=i=>C.readAnswerMeta(i.answer).state,o=new WeakSet;return{canCopy:l,copy:w,stateOf:c,toggleState:async(i,t)=>{if(!(!i.historyId||!n.setHistoryAnswerState||o.has(i))){o.add(i);try{const s=c(i)===t?null:t;await n.setHistoryAnswerState(i.historyId,s),i.answer.answer||(i.answer.answer={reports:[]}),i.answer.answer.state=s}finally{o.delete(i)}}},feedback:async(i,t)=>{!i.historyId||!t.trim()||!n.reportHistoryProblem||await n.reportHistoryProblem(i.historyId,t.trim())},share:async i=>{if(!i.historyId||!n.shareChatHistory)throw new Error("当前回答暂不支持分享");const t=await n.shareChatHistory([i.historyId],d),s=h(t);return await ue(s),s}}},Pe=(e={})=>{const n=e.parsers??[];let h=null,d;const l=ee({...e.chat,parsers:n,onFirstQuestion:({question:t,groupId:s})=>{d==null||d(s,t)}}),w=ve({...e.history,api:l.api,autoLoadMessages:!1,parsers:n});d=(t,s)=>{h=w.renameGroup(t,s).catch(v=>{var a;(a=e.onError)==null||a.call(e,v,"groups")})};const c=ye({...e.agent,api:l.api,autoLoad:!1}),o=(t,s)=>{var v;(v=e.onError)==null||v.call(e,t,s)},L=async()=>{try{await w.loadGroups()}catch(t){o(t,"groups")}},x=async t=>{try{await l.loadGroup(t)}catch(s){o(s,"messages")}},m=async()=>{try{await c.loadAgents()}catch(t){o(t,"agents")}},i=async t=>{var a;const s=typeof t=="string"?{text:t}:t;await l.submitQuestion({...s,entryId:(s==null?void 0:s.entryId)??((a=c.currentAgent.value)==null?void 0:a.entry_id)});const v=h;h=null,v&&await v,await L()};return f.watch(l.session,t=>{t&&(L(),m())}),f.watch(w.activeGroupId,t=>{t&&x(t)}),{chat:l,history:w,agent:c,parsers:n,messages:l.messages,question:l.question,incPrevQuestion:l.incPrevQuestion,talking:l.talking,loading:l.loading,session:l.session,groups:w.groups,activeGroupId:w.activeGroupId,historyLoading:w.loading,agentList:c.agentList,currentAgent:c.currentAgent,agentLoading:c.loading,hasMore:l.hasMore,loadMoreLoading:l.loadMoreLoading,loadGroup:x,loadOlder:l.loadOlder,refreshGroups:L,loadAgents:m,selectAgent:c.selectAgent,getFileUrl:c.getFileUrl,submitQuestion:i,sendWsMessage:l.sendWsMessage,stopQuestion:l.stopQuestion}};exports.createLocalCredentialStore=fe;exports.createRenewer=Z;exports.useAgent=ye;exports.useAnswerActions=Ke;exports.useChat=ee;exports.useChatAuth=Ee;exports.useChatRooms=qe;exports.useChatSession=Pe;exports.useHistory=ve;exports.useKeepAlive=ce;exports.useLlm=Oe;exports.useRunningGroups=ge;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/core/index.d.ts
CHANGED
|
@@ -9,5 +9,17 @@ export { useHistory } from './useHistory';
|
|
|
9
9
|
export type { UseHistoryOptions, UseHistoryReturn } from './useHistory';
|
|
10
10
|
export { useAgent } from './useAgent';
|
|
11
11
|
export type { UseAgentOptions, UseAgentReturn } from './useAgent';
|
|
12
|
+
export { useKeepAlive } from './useKeepAlive';
|
|
13
|
+
export type { UseKeepAliveOptions, UseKeepAliveReturn } from './useKeepAlive';
|
|
14
|
+
export { useRunningGroups } from './useRunningGroups';
|
|
15
|
+
export type { UseRunningGroupsOptions, UseRunningGroupsReturn } from './useRunningGroups';
|
|
16
|
+
export { useChatAuth, createLocalCredentialStore, createRenewer } from './useChatAuth';
|
|
17
|
+
export type { UseChatAuthOptions, UseChatAuthReturn, CredentialStore, RememberedCredential } from './useChatAuth';
|
|
18
|
+
export { useChatRooms } from './useChatRooms';
|
|
19
|
+
export type { UseChatRoomsOptions, UseChatRoomsReturn } from './useChatRooms';
|
|
20
|
+
export { useLlm } from './useLlm';
|
|
21
|
+
export type { LlmTreeNode, UseLlmOptions, UseLlmReturn } from './useLlm';
|
|
22
|
+
export { useAnswerActions } from './useAnswerActions';
|
|
23
|
+
export type { UseAnswerActionsOptions, UseAnswerActionsReturn } from './useAnswerActions';
|
|
12
24
|
export { useChatSession } from './useChatSession';
|
|
13
25
|
export type { UseChatSessionAgentOptions, UseChatSessionChatOptions, UseChatSessionErrorScope, UseChatSessionHistoryOptions, UseChatSessionOptions, UseChatSessionReturn, } from './useChatSession';
|