khoj 1.22.1__py3-none-any.whl → 1.22.2__py3-none-any.whl
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.
- khoj/interface/compiled/404/index.html +1 -1
- khoj/interface/compiled/_next/static/chunks/121-7024f479c297aef0.js +1 -0
- khoj/interface/compiled/_next/static/chunks/1906-1747a36c336df02c.js +3 -0
- khoj/interface/compiled/_next/static/chunks/8423-ce22327cf2d2edae.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/agents/{page-3c01900e7b5c7e50.js → page-922694b75f1fb67b.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/automations/{page-6ea3381528603372.js → page-3f4b6ff0261e19b7.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/chat/{page-f8bc420192b8a6f4.js → page-cc71b18feddf80d6.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/factchecker/page-828cf3c5b8e3af79.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/{page-8f61b4bd2032384a.js → page-30c0b47664930236.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/search/{page-fa15807b1ad7e30b.js → page-dcd385f03255ef36.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/settings/{page-1a2acc46cdabaf4a.js → page-ddcd51147d18c694.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/share/chat/{page-6d1313e0d33b0451.js → page-a84001b4724b5463.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/{webpack-ace3bded0dbc790e.js → webpack-95cfd7a1948cfeed.js} +1 -1
- khoj/interface/compiled/_next/static/css/149abc62de0665c6.css +1 -0
- khoj/interface/compiled/_next/static/css/4cae6c0e5c72fb2d.css +1 -0
- khoj/interface/compiled/agents/index.html +1 -1
- khoj/interface/compiled/agents/index.txt +2 -2
- khoj/interface/compiled/automations/index.html +1 -1
- khoj/interface/compiled/automations/index.txt +2 -2
- khoj/interface/compiled/chat/index.html +1 -1
- khoj/interface/compiled/chat/index.txt +2 -2
- khoj/interface/compiled/factchecker/index.html +1 -1
- khoj/interface/compiled/factchecker/index.txt +2 -2
- khoj/interface/compiled/index.html +1 -1
- khoj/interface/compiled/index.txt +2 -2
- khoj/interface/compiled/search/index.html +1 -1
- khoj/interface/compiled/search/index.txt +2 -2
- khoj/interface/compiled/settings/index.html +1 -1
- khoj/interface/compiled/settings/index.txt +2 -2
- khoj/interface/compiled/share/chat/index.html +1 -1
- khoj/interface/compiled/share/chat/index.txt +2 -2
- khoj/processor/conversation/openai/gpt.py +2 -2
- khoj/processor/conversation/openai/whisper.py +1 -1
- khoj/routers/api_chat.py +476 -0
- khoj/routers/helpers.py +8 -6
- khoj/routers/notion.py +1 -1
- khoj/utils/constants.py +1 -1
- {khoj-1.22.1.dist-info → khoj-1.22.2.dist-info}/METADATA +1 -1
- {khoj-1.22.1.dist-info → khoj-1.22.2.dist-info}/RECORD +44 -43
- khoj/interface/compiled/_next/static/chunks/2614-7cf01576d4457a75.js +0 -3
- khoj/interface/compiled/_next/static/chunks/8423-b6a61d82233d1a82.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/factchecker/page-5c55afdb9dbe8dac.js +0 -1
- khoj/interface/compiled/_next/static/css/3f8ae5fd7b73a9e5.css +0 -1
- khoj/interface/compiled/_next/static/css/592ca99f5122e75a.css +0 -1
- /khoj/interface/compiled/_next/static/{2ItMRj16PRB_daJUGRf2Z → nYZXbNcHRNwkG_SwI54EM}/_buildManifest.js +0 -0
- /khoj/interface/compiled/_next/static/{2ItMRj16PRB_daJUGRf2Z → nYZXbNcHRNwkG_SwI54EM}/_ssgManifest.js +0 -0
- {khoj-1.22.1.dist-info → khoj-1.22.2.dist-info}/WHEEL +0 -0
- {khoj-1.22.1.dist-info → khoj-1.22.2.dist-info}/entry_points.txt +0 -0
- {khoj-1.22.1.dist-info → khoj-1.22.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8423],{38423:function(e,t,n){"use strict";n.d(t,{Z:function(){return I}});var a=n(57437),s=n(37649),r=n.n(s),l=n(2265),o=n(9557),i=n(70571);n(7395);var c=n(77574),d=n(89475),u=n(55631),h=n(5198),f=n(2861),m=n(359),g=n(13493),x=n(88145),p=n(58259),j=n(26100),b=n(86819),v=n(35719),w=n(77689),y=n(86829),N=n(33009),k=n(42491),C=n(93146),D=n(50495),T=n(6780),S=n(19573),R=n(61485),O=n(66820),E=n(19666),z=n(58485),_=n(58575);function I(e){let[t,n]=(0,l.useState)(""),s=(0,l.useRef)(null),[I,L]=(0,l.useState)(null),[M,U]=(0,l.useState)(null),[A,Y]=(0,l.useState)(!1),[F,W]=(0,l.useState)(null),[H,K]=(0,l.useState)(!1),[$,J]=(0,l.useState)(!1),[P,Z]=(0,l.useState)(!1),[B,V]=(0,l.useState)(""),[X,q]=(0,l.useState)(null),[G,Q]=(0,l.useState)(null),[ee,et]=(0,l.useState)(0),[en,ea]=(0,l.useState)(!1);function es(){if(P&&(Z(!1),V(""),e.sendImage(X||"")),t.trim()){if(!e.isLoggedIn){W("Hey there, you need to be signed in to send messages to Khoj AI"),K(!0);return}e.sendMessage(t.trim()),n("")}}function er(t){if(!e.isLoggedIn){W("Whoa! You need to login to upload files"),K(!0);return}let n=["jpg","jpeg","png"];for(let e=0;e<t.length;e++){let a=t[e],s=a.name.split(".").pop();if(n.includes(s||"")){Z(!0),V(URL.createObjectURL(a));return}}(0,o.ko)(t,L,Y,U,e.setUploadedFiles,e.conversationId)}async function el(){try{let e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=new MediaRecorder(e,{mimeType:"audio/webm"}),a=[];t.ondataavailable=async e=>{a.push(e.data);let t=new Blob(a,{type:"audio/webm"}),s=new FormData;s.append("file",t);try{let e=await fetch("/api/transcribe",{method:"POST",body:s});if(!e.ok)throw Error("Network response was not ok");let t=await e.json();n(t.text.trim())}catch(e){console.error("Error sending audio to server:",e)}},t.start(1500),t.onstop=async()=>{let e=new Blob(a,{type:"audio/webm"}),s=new FormData;s.append("file",e);try{let e=await fetch("/api/transcribe",{method:"POST",body:s});if(!e.ok)throw Error("Network response was not ok");let a=await e.json();t.stream.getTracks().forEach(e=>e.stop()),Q(null),n(a.text.trim())}catch(e){console.error("Error sending audio to server:",e)}},Q(t)}catch(e){console.error("Error getting microphone",e)}}(0,l.useEffect)(()=>{if(A||et(0),A){let e=setInterval(()=>{et(e=>{let t=e+(Math.floor(5*Math.random())+1);return t<100?t:100})},800);return()=>clearInterval(e)}},[A]),(0,l.useEffect)(()=>{async function e(){if(B){let e=await fetch(B),t=await e.blob(),n=new FileReader;n.onload=function(){q(n.result)},n.readAsDataURL(t)}Y(!1)}Y(!0),e()},[B]),(0,l.useEffect)(()=>{!$&&G&&G.stop(),$&&!G&&el()},[$,G]);let eo=(0,l.useRef)(null);return(0,l.useEffect)(()=>{eo.current&&(eo.current.style.height="auto",eo.current.style.height=Math.max(eo.current.scrollHeight-24,64)+"px")},[t]),(0,a.jsxs)(a.Fragment,{children:[H&&F&&(0,a.jsx)(O.Z,{onOpenChange:K,loginRedirectMessage:F}),A&&(0,a.jsx)(T.aR,{open:A,children:(0,a.jsxs)(T._T,{children:[(0,a.jsx)(T.fY,{children:(0,a.jsx)(T.f$,{children:"Uploading data. Please wait."})}),(0,a.jsx)(T.yT,{children:(0,a.jsx)(i.E,{indicatorColor:"bg-slate-500",className:"w-full h-2 rounded-full",value:ee})}),(0,a.jsx)(T.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>Y(!1),children:"Dismiss"})]})}),I&&(0,a.jsx)(T.aR,{open:null!==I,children:(0,a.jsxs)(T._T,{children:[(0,a.jsx)(T.fY,{children:(0,a.jsx)(T.f$,{children:"Data Upload Warning"})}),(0,a.jsx)(T.yT,{children:I}),(0,a.jsx)(T.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>L(null),children:"Close"})]})}),M&&(0,a.jsx)(T.aR,{open:null!==M,children:(0,a.jsxs)(T._T,{children:[(0,a.jsxs)(T.fY,{children:[(0,a.jsx)(T.f$,{children:"Oh no!"}),(0,a.jsx)(T.yT,{children:"Something went wrong while uploading your data"})]}),(0,a.jsx)(T.yT,{children:M}),(0,a.jsx)(T.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>U(null),children:"Close"})]})}),t.startsWith("/")&&1===t.split(" ").length&&(0,a.jsx)("div",{className:"flex justify-center text-center",children:(0,a.jsxs)(S.J2,{open:t.startsWith("/"),children:[(0,a.jsx)(R.xo,{className:"flex justify-center text-center"}),(0,a.jsx)(S.yk,{onOpenAutoFocus:e=>e.preventDefault(),className:"".concat(e.isMobileWidth?"w-[100vw]":"w-full"," rounded-md"),children:(0,a.jsxs)(k.mY,{className:"max-w-full",children:[(0,a.jsx)(k.sZ,{placeholder:"Type a command or search...",value:t,className:"hidden"}),(0,a.jsxs)(k.e8,{children:[(0,a.jsx)(k.rb,{children:"No matching commands."}),(0,a.jsx)(k.fu,{heading:"Agent Tools",children:e.chatOptionsData&&Object.entries(e.chatOptionsData).map(e=>{let[t,s]=e;return(0,a.jsx)(k.di,{className:"text-md",onSelect:()=>{n("/".concat(t," "))},children:(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1",children:[(0,a.jsxs)("div",{className:"font-bold flex items-center",children:[function(e){let t="h-4 w-4 mr-2";return e.includes("summarize")?(0,a.jsx)(c.U,{className:t}):e.includes("help")?(0,a.jsx)(d.H,{className:t}):e.includes("automation")?(0,a.jsx)(u.H,{className:t}):e.includes("webpage")?(0,a.jsx)(h.A,{className:t}):e.includes("notes")?(0,a.jsx)(f.a,{className:t}):e.includes("image")?(0,a.jsx)(m.E,{className:t}):e.includes("default")?(0,a.jsx)(g.j,{className:t}):e.includes("general")?(0,a.jsx)(x.K,{className:t}):e.includes("online")?(0,a.jsx)(p.u,{className:t}):(0,a.jsx)(j.o,{className:t})}(t),"/",t]}),(0,a.jsx)("div",{children:s})]})},t)})}),(0,a.jsx)(k.zz,{})]})]})})]})}),(0,a.jsxs)("div",{className:"".concat(r().actualInputArea," items-center justify-between dark:bg-neutral-700 relative"),onDragOver:function(e){e.preventDefault(),ea(!0)},onDragLeave:function(e){e.preventDefault(),ea(!1)},onDrop:function(e){e.preventDefault(),ea(!1),e.dataTransfer.files&&er(e.dataTransfer.files)},children:[P&&(0,a.jsxs)("div",{className:"absolute bottom-[80px] left-0 right-0 dark:bg-neutral-700 bg-white pt-5 pb-5 w-full rounded-lg border dark:border-none grid grid-cols-2",children:[(0,a.jsx)("div",{className:"pl-4 pr-4",children:(0,a.jsx)("img",{src:B,alt:"img",className:"w-auto max-h-[100px]"})}),(0,a.jsx)("div",{className:"pl-4 pr-4",children:(0,a.jsx)(b.X,{className:"w-6 h-6 float-right dark:hover:bg-[hsl(var(--background))] hover:bg-neutral-100 rounded-sm",onClick:function(){Z(!1),V("")}})})]}),(0,a.jsx)("input",{type:"file",multiple:!0,ref:s,onChange:function(e){e.target.files&&er(e.target.files)},style:{display:"none"}}),(0,a.jsx)(D.z,{variant:"ghost",className:"!bg-none p-0 m-2 h-auto text-3xl rounded-full text-gray-300 hover:text-gray-500",disabled:e.sendDisabled,onClick:function(){s.current&&s.current.click()},children:(0,a.jsx)(v.p,{className:"w-8 h-8"})}),(0,a.jsx)("div",{className:"grid w-full gap-1.5 relative",children:(0,a.jsx)(C.g,{ref:eo,className:"border-none w-full h-16 min-h-16 max-h-[128px] md:py-4 rounded-lg resize-none dark:bg-neutral-700 ".concat(e.isMobileWidth?"text-md":"text-lg"),placeholder:"Type / to see a list of commands",id:"message",autoFocus:!0,value:t,onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(Z(!1),V(""),e.preventDefault(),es())},onChange:e=>n(e.target.value),disabled:e.sendDisabled||$})}),$?(0,a.jsx)(E.pn,{children:(0,a.jsxs)(E.u,{children:[(0,a.jsx)(E.aJ,{asChild:!0,children:(0,a.jsx)(D.z,{variant:"default",className:"".concat(!$&&"hidden"," ").concat(e.agentColor?(0,_.tp)(e.agentColor):"bg-orange-300 hover:bg-orange-500"," rounded-full p-1 m-2 h-auto text-3xl transition transform md:hover:-translate-y-1"),onClick:()=>{J(!$)},disabled:e.sendDisabled,children:(0,a.jsx)(w.d,{weight:"fill",className:"w-6 h-6"})})}),(0,a.jsx)(E._v,{children:"Click to stop recording and transcribe your voice."})]})}):G?(0,a.jsx)(z.l,{}):(0,a.jsx)(E.pn,{children:(0,a.jsxs)(E.u,{children:[(0,a.jsx)(E.aJ,{asChild:!0,children:(0,a.jsx)(D.z,{variant:"default",className:"".concat(!t||$||"hidden"," ").concat(e.agentColor?(0,_.tp)(e.agentColor):"bg-orange-300 hover:bg-orange-500"," rounded-full p-1 m-2 h-auto text-3xl transition transform md:hover:-translate-y-1"),onClick:()=>{n("Listening..."),J(!$)},disabled:e.sendDisabled,children:(0,a.jsx)(y.P,{weight:"fill",className:"w-6 h-6"})})}),(0,a.jsx)(E._v,{children:"Click to transcribe your message with voice."})]})}),(0,a.jsx)(D.z,{className:"".concat((!t||$)&&"hidden"," ").concat(e.agentColor?(0,_.tp)(e.agentColor):"bg-orange-300 hover:bg-orange-500"," rounded-full p-1 m-2 h-auto text-3xl transition transform md:hover:-translate-y-1"),onClick:es,disabled:e.sendDisabled,children:(0,a.jsx)(N.a,{className:"w-6 h-6",weight:"bold"})})]}),en&&(0,a.jsx)("div",{className:"text-muted-foreground",children:"Drop file to upload"})]})}},66820:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var a=n(57437),s=n(6780),r=n(87138);function l(e){return(0,a.jsx)(s.aR,{open:!0,onOpenChange:e.onOpenChange,children:(0,a.jsxs)(s._T,{children:[(0,a.jsx)(s.fY,{children:(0,a.jsx)(s.f$,{children:"Sign in to Khoj to continue"})}),(0,a.jsxs)(s.yT,{children:[e.loginRedirectMessage,". By logging in, you agree to our"," ",(0,a.jsx)(r.default,{href:"https://khoj.dev/terms-of-service",children:"Terms of Service."})]}),(0,a.jsxs)(s.xo,{children:[(0,a.jsx)(s.le,{children:"Dismiss"}),(0,a.jsx)(s.OL,{className:"bg-slate-400 hover:bg-slate-500",onClick:()=>{window.location.href="/login?next=".concat(encodeURIComponent(window.location.pathname))},children:(0,a.jsxs)(r.default,{href:"/login?next=".concat(encodeURIComponent(window.location.pathname)),children:[" ","Login"]})})]})]})})}},70571:function(e,t,n){"use strict";n.d(t,{E:function(){return o}});var a=n(57437),s=n(2265),r=n(52431),l=n(37440);let o=s.forwardRef((e,t)=>{let{className:n,value:s,indicatorColor:o,...i}=e;return(0,a.jsx)(r.fC,{ref:t,className:(0,l.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",n),...i,children:(0,a.jsx)(r.z$,{className:"h-full w-full flex-1 bg-primary transition-all ".concat(o),style:{transform:"translateX(-".concat(100-(s||0),"%)")}})})});o.displayName=r.fC.displayName},93146:function(e,t,n){"use strict";n.d(t,{g:function(){return l}});var a=n(57437),s=n(2265),r=n(37440);let l=s.forwardRef((e,t)=>{let{className:n,...s}=e;return(0,a.jsx)("textarea",{className:(0,r.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),ref:t,...s})});l.displayName="Textarea"},19666:function(e,t,n){"use strict";n.d(t,{_v:function(){return d},aJ:function(){return c},pn:function(){return o},u:function(){return i}});var a=n(57437),s=n(2265),r=n(27071),l=n(37440);let o=r.zt,i=r.fC,c=r.xz,d=s.forwardRef((e,t)=>{let{className:n,sideOffset:s=4,...o}=e;return(0,a.jsx)(r.VY,{ref:t,sideOffset:s,className:(0,l.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n),...o})});d.displayName=r.VY.displayName},37649:function(e){e.exports={actualInputArea:"chatInputArea_actualInputArea__Ha6cN"}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6894],{71884:function(e,t,n){Promise.resolve().then(n.bind(n,69769))},18642:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var i=n(57437),a=n(90837),r=n(50495),o=n(83102),s=n(67135),l=n(34797);function c(e){var t;return(0,i.jsxs)(a.Vq,{children:[(0,i.jsx)(a.hg,{asChild:!0,onClick:e.onShare,children:(0,i.jsxs)(r.z,{size:"sm",className:"".concat(e.buttonClassName||"px-3"),variant:null!==(t=e.buttonVariant)&&void 0!==t?t:"default",children:[e.includeIcon&&(0,i.jsx)(l.m,{className:"w-4 h-4 mr-2"}),e.buttonTitle]})}),(0,i.jsxs)(a.cZ,{children:[(0,i.jsxs)(a.fK,{children:[(0,i.jsx)(a.$N,{children:e.title}),(0,i.jsx)(a.Be,{children:e.description})]}),(0,i.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,i.jsxs)("div",{className:"grid flex-1 gap-2",children:[(0,i.jsx)(s._,{htmlFor:"link",className:"sr-only",children:"Link"}),(0,i.jsx)(o.I,{id:"link",defaultValue:e.url,readOnly:!0})]}),(0,i.jsx)(r.z,{type:"submit",size:"sm",className:"px-3",onClick:()=>(function(e){let t=navigator.clipboard;t&&t.writeText(e)})(e.url),children:(0,i.jsx)("span",{children:"Copy"})})]})]})]})}},69769:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return E}});var i=n(57437),a=n(34209),r=n.n(a),o=n(79306),s=n(2265),l=n(89178),c=n(29039),d=n(6780),f=n(53907),h=n.n(f);let u=async e=>(await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}})).json(),m=e=>{let{data:t,error:n}=(0,c.ZP)(e,u);return{data:t,isLoading:!n&&!t,isError:n}},p=async e=>(await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}})).json(),x=e=>{let{data:t,error:n}=(0,c.ZP)(e,p);return{data:t,isLoading:!n&&!t,isError:n}},k=e=>{let{data:t}=m("/api/model/chat/options"),{data:n}=x("/api/model/chat"),[a,r]=s.useState(!1),l=(0,o.G)(),c=e.setModelUsed;return((0,s.useEffect)(()=>{c&&n&&c(n)},[n,c]),t)?(0,i.jsxs)("div",{className:h().modelPicker,children:[(0,i.jsx)("select",{className:h().modelPicker,onChange:n=>{let i=Number(n.target.value),a=t.find(e=>e.id===i);a?function(t){if(!l){r(!0);return}e.setModelUsed&&e.setModelUsed(t),fetch("/api/model/chat?id="+String(t.id),{method:"POST",body:JSON.stringify(t)}).then(e=>{if(!e.ok)throw Error("Failed to select model")}).catch(e=>{console.error("Failed to select model",e)})}(a):console.error("Selected model not found",n.target.value)},disabled:e.disabled,children:null==t?void 0:t.map(t=>(0,i.jsx)("option",{value:t.id,selected:e.initialModel?t.id===e.initialModel.id:(null==n?void 0:n.id)===t.id,children:t.chat_model},t.id))}),(0,i.jsx)(d.aR,{open:a,onOpenChange:r,children:(0,i.jsxs)(d._T,{children:[(0,i.jsxs)(d.fY,{children:[(0,i.jsx)(d.f$,{children:"You must be logged in to configure your model."}),(0,i.jsxs)(d.yT,{children:["Once you create an account with Khoj, you can configure your model and use a whole suite of other features. Check out our"," ",(0,i.jsx)("a",{href:"https://docs.khoj.dev/",children:"documentation"})," to learn more."]})]}),(0,i.jsxs)(d.xo,{children:[(0,i.jsx)(d.le,{children:"Cancel"}),(0,i.jsx)(d.OL,{onClick:()=>{window.location.href=window.location.origin+"/login"},children:"Sign in"})]})]})})]}):(0,i.jsx)("div",{children:"Loading..."})};var j=n(18642),v=n(83102),b=n(50495),g=n(36013),y=n(87138),_=n(48861),C=n(69591);let w=()=>(0,i.jsx)("div",{className:r().loading,children:(0,i.jsxs)("div",{className:r().loadingVerification,children:["Researching...",(0,i.jsxs)("div",{className:r().spinner,children:[(0,i.jsx)("div",{className:"".concat(r().dot1," bg-blue-300")}),(0,i.jsx)("div",{className:"".concat(r().dot2," bg-blue-300")})]})]})});async function N(e,t,n,i,a){n(!0);let r="".concat("Limit your search to reputable sources. Search the internet for relevant supporting or refuting information. Do not reference my notes. Refuse to answer any queries that are not falsifiable by informing me that you will not answer the question. You're not permitted to ask follow-up questions, so do the best with what you have. Respond with **TRUE** or **FALSE** or **INCONCLUSIVE**, then provide your justification. Fact Check:"," ").concat(e),o="".concat("/api/chat","?q=").concat(encodeURIComponent(r),"&client=web&stream=true&conversation_id=").concat(t);try{var s;let e=await fetch(o,{method:"POST"});if(!e.body)throw Error("No response body found");let t=null===(s=e.body)||void 0===s?void 0:s.getReader(),n=new TextDecoder,r="";for(;;){let{done:e,value:o}=await t.read();if(e)break;let s=n.decode(o,{stream:!0});if(s.includes("### compiled references:")){let e=function(e,t){let n=e.split("### compiled references:")[1],i=e.split("### compiled references:")[0],a={};a.response=t+i;let r=JSON.parse(n);return r instanceof Array?a.context=r:"object"==typeof r&&null!==r&&(a.online=r),a}(s,r);e.response&&(r=e.response,i(e.response),a(e))}else r+=s,i(r)}}catch(e){console.error("Error verifying statement: ",e)}finally{n(!1)}}async function S(e){let t=await fetch("/api/chat/sessions?client=web",{method:"POST"});e((await t.json()).conversation_id)}function T(e){let[t,n]=(0,s.useState)(""),[a,r]=(0,s.useState)(!0),o="".concat(e.message,". Use this link for reference: ").concat(e.additionalLink),c=(0,C.IC)();return(0,s.useEffect)(()=>{e.prefilledResponse?(n(e.prefilledResponse),r(!1)):N(o,e.conversationId,r,n,()=>{})},[o,e.conversationId,e.prefilledResponse]),(0,s.useEffect)(()=>{""!==t&&(e.prefilledResponse||a||e.setChildReferencesCallback(e.additionalLink,t,e.linkTitle))},[t,a,e]),(0,i.jsxs)("div",{children:[a&&(0,i.jsx)(w,{}),(0,i.jsx)(l.Z,{chatMessage:{automationId:"",by:"AI",message:t,context:[],created:new Date().toISOString(),onlineContext:{}},isMobileWidth:c})]})}function I(e){var t,n,a;let o=e.linkTitle||(null===(a=e.onlineData)||void 0===a?void 0:null===(n=a.organic)||void 0===n?void 0:null===(t=n[0])||void 0===t?void 0:t.title)||"Reference",s={link:e.additionalLink};return(0,i.jsxs)(g.Zb,{className:"mt-2 mb-4",children:[(0,i.jsxs)(g.Ol,{children:[(0,i.jsx)("a",{className:r().titleLink,href:e.additionalLink,target:"_blank",rel:"noreferrer",children:o}),(0,i.jsx)(L,{...s})]}),(0,i.jsx)(g.aY,{children:(0,i.jsx)(T,{additionalLink:e.additionalLink,message:e.officialFactToVerify,linkTitle:o,conversationId:e.conversationId,setChildReferencesCallback:e.setChildReferencesCallback,prefilledResponse:e.prefilledResponse})})]})}let L=e=>{let t=new URL(e.link).hostname;return(0,i.jsx)("div",{className:r().subLinks,children:(0,i.jsx)("a",{className:"".concat(r().subLinks," bg-blue-200 px-2"),href:e.link,target:"_blank",rel:"noreferrer",children:t})})};function E(){let[e,t]=(0,s.useState)(""),[n,a]=(0,s.useState)(""),[c,d]=(0,s.useState)(!1),[f,h]=(0,s.useState)(""),[u,m]=(0,s.useState)(!1),[p,x]=(0,s.useState)(),[T,E]=(0,s.useState)(),[R,F]=(0,s.useState)(),O=(0,C.IC)(),[A,P]=(0,s.useState)(""),[V,M]=(0,s.useState)(""),[U,D]=(0,s.useState)(!1),[q,Z]=(0,s.useState)();function B(e,t,n){let i=T||[];i.find(t=>t.additionalLink===e)||(i.push({additionalLink:e,response:t,linkTitle:n}),E(i))}let z=(0,o.G)();function Y(){if(u)return;if(!e){alert("Please enter a fact to verify.");return}if(m(!0),!z){let e=window.location.href;window.location.href="/login?next=".concat(e)}x(void 0),h(""),S(P);let t=[...Array(16)].map(()=>Math.random().toString(36)[2]).join("");M(t),window.history.pushState({},document.title,window.location.pathname+"?runId=".concat(t)),a(e),m(!1)}(0,s.useEffect)(()=>{e?document.title="AI Fact Check: ".concat(e):document.title="AI Fact Checker"},[e]),(0,s.useEffect)(()=>{let e=localStorage.getItem("factToVerify");e&&t(e);let n=new URLSearchParams(window.location.search),i=n.get("factToVerify");i&&t(i);let r=n.get("runId");r&&(M(r),(async()=>{try{let e=await fetch("/api/chat/store/factchecker?runId=".concat(r));if(200!==e.status)throw Error("Failed to fetch stored data");let t=JSON.parse(await e.json());t&&(a(t.factToVerify),h(t.response),x(t.references),E(t.childReferences),Z(t.modelUsed)),D(!0)}catch(e){console.error("Error fetching stored data: ",e)}})())},[]),(0,s.useEffect)(()=>{A&&N(n,A,d,h,x)},[A,n]),(0,s.useEffect)(()=>{localStorage.setItem("factToVerify",e)},[e]),(0,s.useEffect)(()=>{let e=document.querySelector('meta[name="description"]');e&&e.setAttribute("content",f);let t=document.querySelector('meta[property="og:description"]');t||((t=document.createElement("meta")).setAttribute("property","og:description"),document.getElementsByTagName("head")[0].appendChild(t)),t.setAttribute("content",f)},[f]);let J=e=>e.map((e,t)=>(0,i.jsx)(I,{additionalLink:e.additionalLink,officialFactToVerify:n,conversationId:A,linkTitle:e.linkTitle,setChildReferencesCallback:B,prefilledResponse:e.response},t)),W=e=>e instanceof Array?e.map((e,t)=>L(e)):L(e);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"relative md:fixed h-full",children:(0,i.jsx)(_.Z,{conversationId:null,uploadedFiles:[],isMobileWidth:O})}),(0,i.jsxs)("div",{className:r().factCheckerContainer,children:[(0,i.jsx)("h1",{className:"".concat(r().response," pt-8 md:pt-4 font-large outline-slate-800 dark:outline-slate-200"),children:"AI Fact Checker"}),(0,i.jsx)("footer",{className:"".concat(r().footer," mt-4"),children:"This is an experimental AI tool. It may make mistakes."}),f&&p&&T?(0,i.jsxs)("div",{className:r().reportActions,children:[(0,i.jsx)(b.z,{asChild:!0,variant:"secondary",children:(0,i.jsx)(y.default,{href:"/factchecker",target:"_blank",rel:"noopener noreferrer",children:"Try Another"})}),(0,i.jsx)(j.Z,{buttonTitle:"Share report",title:"AI Fact Checking Report",description:"Share this fact checking report with others. Anyone who has this link will be able to view the report.",url:function(){let e=new URL(window.location.href);return e.searchParams.set("runId",V),e.href}(),onShare:U?()=>{}:function(){fetch("/api/chat/store/factchecker",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runId:V,storeData:{factToVerify:e,response:f,references:p,childReferences:T,runId:V,modelUsed:R}})})}})]}):(0,i.jsxs)("div",{className:r().newReportActions,children:[(0,i.jsxs)("div",{className:"".concat(r().inputFields," mt-4"),children:[(0,i.jsx)(v.I,{type:"text",maxLength:200,placeholder:"Enter a falsifiable statement to verify",disabled:c,onChange:e=>t(e.target.value),value:e,onKeyDown:e=>{"Enter"===e.key&&Y()},onFocus:e=>e.target.placeholder="",onBlur:e=>e.target.placeholder="Enter a falsifiable statement to verify"}),(0,i.jsx)(b.z,{disabled:u,onClick:()=>Y(),children:"Verify"})]}),(0,i.jsxs)("h3",{className:"mt-4 mb-4",children:["Try with a particular model. You must be"," ",(0,i.jsx)("a",{href:"/settings",className:"font-medium text-blue-600 dark:text-blue-500 hover:underline",children:"subscribed"})," ","to configure the model."]})]}),(0,i.jsx)(k,{disabled:c||U,setModelUsed:F,initialModel:q}),c&&(0,i.jsx)("div",{className:r().loading,children:(0,i.jsx)(w,{})}),f&&(0,i.jsxs)(g.Zb,{className:"mt-4",children:[(0,i.jsx)(g.Ol,{children:(0,i.jsx)(g.ll,{children:n})}),(0,i.jsx)(g.aY,{children:(0,i.jsx)("div",{className:r().responseText,children:(0,i.jsx)(l.Z,{chatMessage:{automationId:"",by:"AI",message:f,context:[],created:new Date().toISOString(),onlineContext:{}},isMobileWidth:O})})}),(0,i.jsx)(g.eW,{children:p&&p.online&&Object.keys(p.online).length>0&&(0,i.jsx)("div",{className:r().subLinks,children:Object.entries(p.online).map((e,t)=>{let[n,i]=e;return W((null==i?void 0:i.webpages)||[])})})})]}),p&&(0,i.jsxs)("div",{className:r().referenceContainer,children:[(0,i.jsx)("h2",{className:"mt-4 mb-4",children:"Supplements"}),(0,i.jsx)("div",{className:r().references,children:void 0!==p.online&&((e,t,n,a,r)=>{if(a&&r)return J(r);let o=new Set;return Object.entries(t.online||{}).map((e,t)=>{let[n,i]=e,a=(null==i?void 0:i.webpages)||[];if(a instanceof Array)for(let e=0;e<a.length;e++){let t=a[e].link||"";if(o.has(t))return null;o.add(t)}else{let e=a.link||"";if(o.has(e))return null;o.add(e)}}),Object.entries(t.online||{}).map((t,a)=>{var r,s;let[l,c]=t,d="";for(let e=0;e<(null==c?void 0:null===(r=c.organic)||void 0===r?void 0:r.length)&&(d=(null==c?void 0:null===(s=c.organic)||void 0===s?void 0:s[e]).link||"",o.has(d));e++);return(o.add(d),""===d)?null:(0,i.jsx)(I,{onlineData:c,officialFactToVerify:n,conversationId:e,additionalLink:d,setChildReferencesCallback:B},a)}).filter(Boolean)})(A,p,n,U,T)})]})]})]})}},67135:function(e,t,n){"use strict";n.d(t,{_:function(){return c}});var i=n(57437),a=n(2265),r=n(38364),o=n(12218),s=n(37440);let l=(0,o.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=a.forwardRef((e,t)=>{let{className:n,...a}=e;return(0,i.jsx)(r.f,{ref:t,className:(0,s.cn)(l(),n),...a})});c.displayName=r.f.displayName},53907:function(e){e.exports={modelPicker:"modelPicker_modelPicker__chlCh"}},34209:function(e){e.exports={factVerification:"factChecker_factVerification__UCbIf",factCheckerContainer:"factChecker_factCheckerContainer__Brqjv",responseText:"factChecker_responseText__HzSck",response:"factChecker_response__HaFuc",titleLink:"factChecker_titleLink__FA5mt",subLinks:"factChecker_subLinks__iaFHn",reference:"factChecker_reference___6Fwh",footer:"factChecker_footer__Tbj3t",reportActions:"factChecker_reportActions__2_tFq",factCheckButton:"factChecker_factCheckButton__2XPTv",spinner:"factChecker_spinner__T26Jv","sk-rotate":"factChecker_sk-rotate__ogES_",inputFields:"factChecker_inputFields__LU3cQ",dot1:"factChecker_dot1__n9Bu5",dot2:"factChecker_dot2__HDdBs","sk-bounce":"factChecker_sk-bounce__q4XFt"}},38364:function(e,t,n){"use strict";n.d(t,{f:function(){return s}});var i=n(2265),a=n(25171),r=n(57437),o=i.forwardRef((e,t)=>(0,r.jsx)(a.WV.label,{...e,ref:t,onMouseDown:t=>{var n;t.target.closest("button, input, select, textarea")||(null===(n=e.onMouseDown)||void 0===n||n.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));o.displayName="Label";var s=o}},function(e){e.O(0,[6129,9427,929,3954,9001,3062,743,2614,1603,9417,9178,2971,7023,1744],function(){return e(e.s=71884)}),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
div.automations_automationsLayout__Atoh_{display:grid;grid-template-columns:1fr 1fr;gap:1rem}div.automations_automationCard__BKidA{display:grid;grid-template-rows:auto 1fr auto}div.automations_pageLayout__OaoYA{max-width:60vw;margin:auto auto 2rem}div.automations_sidePanel__MPciO{position:fixed;height:100%;z-index:1}@media screen and (max-width:768px){div.automations_automationsLayout__Atoh_{grid-template-columns:1fr}div.automations_pageLayout__OaoYA{max-width:90vw}div.automations_sidePanel__MPciO{position:relative;height:100%}}div.sidePanel_session__R9wgH{padding:.5rem;margin-bottom:.25rem;border-radius:.5rem;cursor:pointer;max-width:14rem;font-size:medium;display:grid;grid-template-columns:minmax(auto,400px) 1fr;gap:0}div.sidePanel_compressed__YBPtM{grid-template-columns:minmax(12rem,100%) 1fr 1fr}div.sidePanel_sessionHover__iwfo8,div.sidePanel_session__R9wgH:hover{background-color:hsla(var(--popover))}div.sidePanel_session__R9wgH:hover{color:hsla(var(--popover-foreground))}div.sidePanel_session__R9wgH a{text-decoration:none}button.sidePanel_button__ihOfG{border:none;outline:none;background-color:transparent;cursor:pointer;color:var(--main-text-color);width:24px}button.sidePanel_showMoreButton__dt9Zw{border-radius:.5rem;padding:8px}div.sidePanel_panel__VZ8ye{display:flex;flex-direction:column;padding:1rem;overflow-y:auto;max-width:auto;transition:background-color .5s}div.sidePanel_expanded__ZjTHo{gap:1rem;background-color:hsla(var(--muted));height:100%}div.sidePanel_collapsed__OjVmG{display:grid;grid-template-columns:1fr;height:-moz-fit-content;height:fit-content;padding:1rem 0 0 1rem}p.sidePanel_session__R9wgH{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;text-align:left;font-size:small}div.sidePanel_header__d5cGA{display:grid;grid-template-columns:1fr auto}div.sidePanel_profile__x0w58{display:grid;grid-template-columns:auto 1fr;gap:1rem;align-items:center;margin-top:auto}div.sidePanel_panelWrapper__k_lal{display:grid;grid-template-rows:1fr auto auto;height:100%}div.sidePanel_modalSessionsList__nKe2n{position:fixed;top:0;left:0;width:100%;height:100%;background-color:hsla(var(--frosted-background-color));z-index:1;display:flex;justify-content:center;align-items:center;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}div.sidePanel_modalSessionsList__nKe2n div.sidePanel_content__Wq20_{max-width:80%;max-height:80%;background-color:hsla(var(--frosted-background-color));overflow:auto;padding:20px;border-radius:10px}div.sidePanel_modalSessionsList__nKe2n div.sidePanel_session__R9wgH{max-width:100%;text-overflow:ellipsis}@media screen and (max-width:768px){div.sidePanel_panel__VZ8ye{padding:.25rem;width:100%}div.sidePanel_expanded__ZjTHo{z-index:1}div.sidePanel_singleReference__r9z1n{padding:4px}div.sidePanel_panelWrapper__k_lal{width:100%;padding:0 1rem}div.sidePanel_session__R9wgH.sidePanel_compressed__YBPtM{max-width:100%;display:grid;grid-template-columns:70vw auto;justify-content:space-between}div.sidePanel_session__R9wgH{max-width:100%;grid-template-columns:minmax(auto,70vw) 1fr}}menu.navMenu_menu__fqlFF a{text-decoration:none;font-size:medium;font-weight:400;padding:0 4px;border-radius:4px;display:flex;justify-self:center;margin:0;align-items:center;gap:4px}a.navMenu_selected__A__aP{background-color:hsl(var(--accent))}div.navMenu_titleBar__HJoio{display:flex;justify-content:space-between;align-content:space-evenly;align-items:start}div.navMenu_titleBar__HJoio menu{padding:0;margin:0;border-radius:.5rem;display:grid;grid-auto-flow:column;gap:32px}div.navMenu_settingsMenuProfile__3npiK img{border-radius:50%;width:32px;height:32px;margin:0}div.navMenu_settingsMenu__X2i2U{padding:0 4px;border-radius:4px;display:flex;justify-self:center;margin:0;align-items:center}div.navMenu_settingsMenuOptions__KWnLv{display:block;grid-auto-flow:row;position:absolute;background-color:var(--background-color);box-shadow:0 8px 16px 0 rgba(0,0,0,.2);top:64px;text-align:left;padding:8px;border-radius:8px}@media screen and (max-width:600px){menu.navMenu_menu__fqlFF span{display:none}div.navMenu_settingsMenuOptions__KWnLv{right:4px}div.navMenu_titleBar__HJoio{padding:8px}}div.chatHistory_chatHistory__CoaVT{display:flex;flex-direction:column;height:100%}div.chatHistory_chatLayout__ABli_{height:80vh;overflow-y:auto;margin:0 auto}div.chatHistory_agentIndicator__wOU1f a{display:flex;text-align:center;align-content:center;align-items:center}div.chatHistory_trainOfThought__mMWSR{border:1px solid var(--border-color);border-radius:16px;padding:8px 16px;margin:12px}div.chatMessage_chatMessageContainer__sAivf{display:flex;flex-direction:column;margin:12px;border-radius:16px;padding:8px 16px 0}div.chatMessage_chatMessageWrapper__u5m8A{padding-left:1rem;padding-bottom:1rem;max-width:80vw}div.chatMessage_chatMessageWrapper__u5m8A p:not(:last-child){margin-bottom:16px}div.chatMessage_khojfullHistory__NPu2l{border-width:1px;padding-left:4px}div.chatMessage_youfullHistory__ioyfH{max-width:100%}div.chatMessage_chatMessageContainer__sAivf.chatMessage_youfullHistory__ioyfH{padding-left:0}div.chatMessage_you__6GUC4{background-color:hsla(var(--secondary));align-self:flex-end;border-radius:16px}div.chatMessage_khoj__cjWON{background-color:transparent;color:hsl(var(--accent-foreground));align-self:flex-start}div.chatMessage_khojChatMessage__BabQz{padding-top:8px;padding-left:16px}div.chatMessage_chatMessageContainer__sAivf img{width:50%}div.chatMessage_chatMessageContainer__sAivf h3 img{width:24px}div.chatMessage_you__6GUC4 img{height:16rem;width:auto}div.chatMessage_you__6GUC4{color:hsla(var(--secondary-foreground))}div.chatMessage_author__muRtC{font-size:.75rem;color:grey;text-align:right}div.chatMessage_chatFooter__0vR8s{display:flex;justify-content:space-between;min-height:28px}div.chatMessage_chatButtons__Lbk8T{display:flex;justify-content:flex-end;width:-moz-min-content;width:min-content;border:1px solid var(--border-color);border-radius:16px;position:relative;bottom:-12px;background-color:hsla(var(--secondary))}div.chatMessage_chatFooter__0vR8s button{cursor:pointer;color:hsl(var(--muted-foreground));border:none;border-radius:16px;padding:4px;margin-left:4px;margin-right:4px}div.chatMessage_chatFooter__0vR8s button:hover{background-color:hsla(var(--frosted-background-color))}button.chatMessage_codeCopyButton__Y_Ujv{cursor:pointer;float:right;border-radius:8px}button.chatMessage_codeCopyButton__Y_Ujv:hover{color:hsla(var(--frosted-background-color))}button.chatMessage_codeCopyButton__Y_Ujv img,button.chatMessage_copyButton__jd7q7 img,div.chatMessage_feedbackButtons___Brdy img{width:24px}div.chatMessage_trainOfThought__mR2Gg strong{font-weight:500}div.chatMessage_trainOfThought__mR2Gg.chatMessage_primary__WYPEb strong{font-weight:500;color:hsla(var(--secondary-foreground))}div.chatMessage_trainOfThought__mR2Gg.chatMessage_primary__WYPEb p{color:inherit}div.chatMessage_trainOfThoughtElement__le_bC{display:grid;grid-template-columns:auto 1fr}@media screen and (max-width:768px){div.chatMessage_youfullHistory__ioyfH{max-width:90%}}div.chatInputArea_actualInputArea__Ha6cN{display:grid;grid-template-columns:auto 1fr auto auto}div.search_searchLayout__fP3m0{display:grid;grid-template-columns:1fr;gap:1rem;height:100vh}div.search_sidePanel__myfc9{position:fixed;height:100%;z-index:1}@media screen and (max-width:768px){div.search_searchLayout__fP3m0{gap:0}div.search_sidePanel__myfc9{position:relative;height:100%}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
div.agents_titleBar__FzYbY{padding:16px 0;text-align:left}.agents_agentPersonality__o0Ysz p{white-space:inherit;overflow:hidden;height:77px;line-height:1.5}div.agents_agentPersonality__o0Ysz{text-align:left;grid-column:span 3;overflow:hidden}div.agents_pageLayout__gR3S3{max-width:60vw;margin:auto auto 2rem}div.agents_sidePanel__wGVGc{position:fixed;height:100%;z-index:1}button.agents_infoButton__NqI7E{border:none;background-color:transparent!important;text-align:left;font-family:inherit;font-size:medium}div.agents_agentList__XVx4A{display:grid;gap:20px;padding-top:30px;margin-right:auto;grid-auto-flow:row;grid-template-columns:1fr 1fr;margin-left:auto}@media only screen and (max-width:768px){div.agents_agentList__XVx4A{width:100%;padding:0;margin-right:auto;margin-left:auto;grid-template-columns:1fr}div.agents_pageLayout__gR3S3{max-width:90vw}div.agents_sidePanel__wGVGc{position:relative;height:100%}}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|