khoj 1.24.1.dev7__py3-none-any.whl → 1.24.2.dev3__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/database/adapters/__init__.py +8 -1
- khoj/interface/compiled/404/index.html +1 -1
- khoj/interface/compiled/_next/static/chunks/1603-3e2e1528e3b6ea1d.js +1 -0
- khoj/interface/compiled/_next/static/chunks/{9178-f478bc3670cc0cb8.js → 9178-7e815211edcb3657.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/automations/page-0a5de8c254c29a1c.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/chat/page-d96bf6a84bb05290.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/share/chat/page-f06ac16cfe5b5a16.js +1 -0
- khoj/interface/compiled/_next/static/chunks/{webpack-d5a40bbe9f041987.js → webpack-d4781cada9b58e75.js} +1 -1
- 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/interface/web/login.html +261 -159
- khoj/processor/conversation/anthropic/anthropic_chat.py +2 -3
- khoj/processor/conversation/google/gemini_chat.py +2 -3
- khoj/processor/conversation/offline/chat_model.py +2 -3
- khoj/processor/conversation/openai/gpt.py +2 -3
- khoj/processor/tools/online_search.py +5 -5
- khoj/routers/api_chat.py +15 -6
- khoj/routers/helpers.py +3 -4
- khoj/utils/helpers.py +23 -0
- khoj/utils/rawconfig.py +11 -0
- {khoj-1.24.1.dev7.dist-info → khoj-1.24.2.dev3.dist-info}/METADATA +1 -1
- {khoj-1.24.1.dev7.dist-info → khoj-1.24.2.dev3.dist-info}/RECORD +45 -45
- khoj/interface/compiled/_next/static/chunks/1603-e13f41ec2cb3f147.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/automations/page-e0bedd962fcfa0dd.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/chat/page-1b886aa4f57af1fa.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/share/chat/page-7df9c23b5fec66de.js +0 -1
- /khoj/interface/compiled/_next/static/{iZkIzW249gxw1JKlivPbz → _29ceahp81LhuIHo5QgOD}/_buildManifest.js +0 -0
- /khoj/interface/compiled/_next/static/{iZkIzW249gxw1JKlivPbz → _29ceahp81LhuIHo5QgOD}/_ssgManifest.js +0 -0
- /khoj/interface/compiled/_next/static/chunks/{8423-7f5eb790353afe24.js → 8423-62ac6c832be2461b.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{9417-2e54c6fd056982d8.js → 9417-5d14ac74aaab2c66.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/app/agents/{page-f41c3b57b5bfc0bd.js → page-d302911777a3e027.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/app/{page-a31799b4c4b78da6.js → page-96cab08c985716f4.js} +0 -0
- {khoj-1.24.1.dev7.dist-info → khoj-1.24.2.dev3.dist-info}/WHEEL +0 -0
- {khoj-1.24.1.dev7.dist-info → khoj-1.24.2.dev3.dist-info}/entry_points.txt +0 -0
- {khoj-1.24.1.dev7.dist-info → khoj-1.24.2.dev3.dist-info}/licenses/LICENSE +0 -0
@@ -1 +0,0 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1929],{39929:function(e,t,s){Promise.resolve().then(s.bind(s,38874))},38874:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return p}});var a=s(57437),o=s(65104),n=s.n(o),i=s(2265),r=s(48861),c=s(82697),l=s(16463),d=s(58485),u=s(9557);s(7395);var h=s(69591),m=s(38423),g=s(79306);function f(e){let t=(0,l.useSearchParams)().get("conversationId"),[s,o]=(0,i.useState)(""),[r,d]=(0,i.useState)(null),[u,h]=(0,i.useState)(!1),[g,f]=(0,i.useState)(null),p=e.setQueryToProcess,x=e.onConversationIdChange;if((0,i.useEffect)(()=>{r&&e.setImage64(encodeURIComponent(r))},[r,e.setImage64]),(0,i.useEffect)(()=>{let t=localStorage.getItem("image");t&&(d(t),e.setImage64(encodeURIComponent(t)),localStorage.removeItem("image"));let s=localStorage.getItem("message");s&&(h(!0),p(s))},[p]),(0,i.useEffect)(()=>{s&&(h(!0),p(s))},[s,p]),(0,i.useEffect)(()=>{t&&(null==x||x(t))},[t,x]),(0,i.useEffect)(()=>{e.streamedMessages&&e.streamedMessages.length>0&&e.streamedMessages[e.streamedMessages.length-1].completed?h(!1):o("")},[e.streamedMessages]),!t){window.location.href="/";return}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:n().chatBodyFull,children:(0,a.jsx)(c.Z,{conversationId:t,setTitle:e.setTitle,setAgent:f,pendingMessage:u?s:"",incomingMessages:e.streamedMessages})}),(0,a.jsx)("div",{className:"".concat(n().inputBox," p-1 md:px-2 shadow-md bg-background align-middle items-center justify-center dark:bg-neutral-700 dark:border-0 dark:shadow-sm rounded-t-2xl rounded-b-none md:rounded-xl h-fit"),children:(0,a.jsx)(m.Z,{agentColor:null==g?void 0:g.color,isLoggedIn:e.isLoggedIn,sendMessage:e=>o(e),sendImage:e=>d(e),sendDisabled:u,chatOptionsData:e.chatOptionsData,conversationId:t,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles})})]})}function p(){let e="Khoj AI - Chat",[t,s]=(0,i.useState)(null),[o,c]=(0,i.useState)(!0),[l,m]=(0,i.useState)(e),[p,x]=(0,i.useState)(null),[_,y]=(0,i.useState)([]),[w,I]=(0,i.useState)(""),[S,b]=(0,i.useState)(!1),[v,j]=(0,i.useState)([]),[B,C]=(0,i.useState)(""),E=(0,h.k6)(),T=(0,g.G)(),k=(0,h.IC)();async function M(e){if(!e.ok)throw Error(e.statusText);if(!e.body)throw Error("Response body is null");let t=e.body.getReader(),s=new TextDecoder,a="␃\uD83D\uDD1A␗",o="",n=[],i={};for(;;){let e;let{done:r,value:c}=await t.read();if(r){I(""),b(!1),C("");break}for(o+=s.decode(c,{stream:!0});-1!==(e=o.indexOf(a));){let t=o.slice(0,e);if(o=o.slice(e+a.length),t){let e=_.find(e=>!e.completed);if(!e){console.error("No current message found");return}({context:n,onlineContext:i}=(0,u.VK)(t,e,n,i)),y([..._])}}}}async function N(){if(localStorage.removeItem("message"),!w||!p)return;let e={q:w,conversation_id:p,stream:!0,...E&&{region:E.region,country:E.country,city:E.city,timezone:E.timezone},...B&&{image:B}},t=await fetch("/api/chat?client=web",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});try{await M(t)}catch(s){console.error(s);let e=_.find(e=>!e.completed);if(!e)return;let t=s.message;t.includes("Error in input stream")?e.rawResponse="Woops! The connection broke while I was writing my thoughts down. Maybe try again in a bit or dislike this message if the issue persists?":e.rawResponse="Umm, not sure what just happened. I see this error message: ".concat(t,". Could you try again or dislike this message if the issue persists?"),e.completed=!0,y([..._]),I(""),b(!1)}}return((0,i.useEffect)(()=>{fetch("/api/chat/options").then(e=>e.json()).then(e=>{c(!1),e&&s(e)}).catch(e=>{console.error(e)}),(0,h.EK)()},[]),(0,i.useEffect)(()=>{if(w){let e={rawResponse:"",trainOfThought:[],context:[],onlineContext:{},completed:!1,timestamp:new Date().toISOString(),rawQuery:w||"",uploadedImageData:decodeURIComponent(B)};y(t=>[...t,e]),b(!0)}},[w]),(0,i.useEffect)(()=>{S&&N()},[S]),o)?(0,a.jsx)(d.Z,{}):(0,a.jsxs)("div",{className:"".concat(n().main," ").concat(n().chatLayout),children:[(0,a.jsx)("title",{children:"".concat(e).concat(l&&l!==e?": ".concat(l):"")}),(0,a.jsx)("div",{children:(0,a.jsx)(r.ZP,{conversationId:p,uploadedFiles:v,isMobileWidth:k})}),(0,a.jsx)("div",{className:n().chatBox,children:(0,a.jsxs)("div",{className:n().chatBoxBody,children:[!k&&p&&(0,a.jsxs)("div",{className:"".concat(n().chatTitleWrapper," text-nowrap text-ellipsis overflow-hidden max-w-screen-md grid items-top font-bold mr-8 pt-6 col-auto h-fit"),children:[l&&(0,a.jsx)("h2",{className:"text-lg text-ellipsis whitespace-nowrap overflow-x-hidden",children:l}),(0,a.jsx)(r.En,{conversationId:p,setTitle:m,sizing:"md"})]}),(0,a.jsx)(i.Suspense,{fallback:(0,a.jsx)(d.Z,{}),children:(0,a.jsx)(f,{isLoggedIn:null!==T,streamedMessages:_,chatOptionsData:t,setTitle:m,setQueryToProcess:I,setUploadedFiles:j,isMobileWidth:k,onConversationIdChange:e=>{x(e)},setImage64:C})})]})})]})}},16463:function(e,t,s){"use strict";var a=s(71169);s.o(a,"useSearchParams")&&s.d(t,{useSearchParams:function(){return a.useSearchParams}})},65104:function(e){e.exports={main:"chat_main__8xQu5",suggestions:"chat_suggestions__m8n2t",inputBox:"chat_inputBox__LOFws",chatBodyFull:"chat_chatBodyFull__FfKEK",chatBody:"chat_chatBody__sS1LX",chatLayout:"chat_chatLayout__pR203",chatBox:"chat_chatBox__FBct_",titleBar:"chat_titleBar__R5QlK",chatBoxBody:"chat_chatBoxBody__qT_SC",agentIndicator:"chat_agentIndicator__8V55w",chatTitleWrapper:"chat_chatTitleWrapper__6ChWq"}}},function(e){e.O(0,[7812,647,929,3954,9001,3062,743,121,7071,4051,9984,1603,9417,9178,8423,2697,2971,7023,1744],function(){return e(e.s=39929)}),_N_E=e.O()}]);
|
@@ -1 +0,0 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3111],{91955:function(e,t,s){Promise.resolve().then(s.bind(s,5506))},5506:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return f}});var a=s(57437),n=s(11930),o=s.n(n),i=s(2265),r=s(48861),c=s(82697),d=s(58485);s(7395);var l=s(69591),u=s(79306),h=s(38423),g=s(9557);function p(e){let[t,s]=(0,i.useState)(""),[n,r]=(0,i.useState)(null),[d,l]=(0,i.useState)(!1),[u,g]=(0,i.useState)(null),p=e.setQueryToProcess,f=e.streamedMessages;return((0,i.useEffect)(()=>{n&&e.setImage64(encodeURIComponent(n))},[n,e.setImage64]),(0,i.useEffect)(()=>{t&&(l(!0),p(t))},[t,p]),(0,i.useEffect)(()=>{f&&f.length>0&&f[f.length-1].completed?l(!1):s("")},[f]),e.publicConversationSlug||e.conversationId)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:o().chatBodyFull,children:(0,a.jsx)(c.Z,{publicConversationSlug:e.publicConversationSlug,conversationId:e.conversationId||"",setAgent:g,setTitle:e.setTitle,pendingMessage:d?t:"",incomingMessages:e.streamedMessages})}),(0,a.jsx)("div",{className:"".concat(o().inputBox," p-1 md:px-2 shadow-md bg-background align-middle items-center justify-center dark:bg-neutral-700 dark:border-0 dark:shadow-sm rounded-t-2xl rounded-b-none md:rounded-xl"),children:(0,a.jsx)(h.Z,{isLoggedIn:e.isLoggedIn,sendMessage:e=>s(e),sendImage:e=>r(e),sendDisabled:d,chatOptionsData:e.chatOptionsData,conversationId:e.conversationId,agentColor:null==u?void 0:u.color,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles})})]}):(0,a.jsx)("div",{className:o().suggestions,children:"Whoops, nothing to see here!"})}function f(){let[e,t]=(0,i.useState)(null),[s,n]=(0,i.useState)(!0),[c,h]=(0,i.useState)("Khoj AI - Chat"),[f,m]=(0,i.useState)(void 0),[_,x]=(0,i.useState)([]),[y,v]=(0,i.useState)(""),[b,C]=(0,i.useState)(!1),[S,j]=(0,i.useState)([]),[I,B]=(0,i.useState)(void 0),[w,O]=(0,i.useState)(""),N=(0,l.k6)(),k=(0,u.G)(),D=(0,l.IC)();async function E(e){if(!e.ok)throw Error(e.statusText);if(!e.body)throw Error("Response body is null");let t=e.body.getReader(),s=new TextDecoder,a="␃\uD83D\uDD1A␗",n="";for(;;){let e;let{done:o,value:i}=await t.read();if(o){v(""),C(!1),O("");break}for(n+=s.decode(i,{stream:!0});-1!==(e=n.indexOf(a));){let t=n.slice(0,e);if(n=n.slice(e+a.length),t){let e=_.find(e=>!e.completed);if(!e){console.error("No current message found");return}(0,g.VK)(t,e),x([..._])}}}}async function T(){if(!y||!f)return;let e={q:y,conversation_id:f,stream:!0,...N&&{region:N.region,country:N.country,city:N.city,timezone:N.timezone},...w&&{image:w}},t=await fetch("/api/chat?client=web",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});try{await E(t)}catch(e){console.error(e)}}return((0,i.useEffect)(()=>{fetch("/api/chat/options").then(e=>e.json()).then(e=>{n(!1),e&&t(e)}).catch(e=>{console.error(e)}),(0,l.EK)(),B(window.location.pathname.split("/").pop()||"")},[]),(0,i.useEffect)(()=>{if(y&&!f){fetch("/api/chat/share/fork?public_conversation_slug=".concat(I),{method:"POST",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{m(e.conversation_id)}).catch(e=>{console.error(e)});return}if(y){let e={rawResponse:"",trainOfThought:[],context:[],onlineContext:{},completed:!1,timestamp:new Date().toISOString(),rawQuery:y||"",uploadedImageData:decodeURIComponent(w)};x(t=>[...t,e]),C(!0)}},[y,f,I]),(0,i.useEffect)(()=>{b&&T()},[b]),s)?(0,a.jsx)(d.Z,{}):I?(0,a.jsxs)("div",{className:"".concat(o().main," ").concat(o().chatLayout),children:[(0,a.jsx)("title",{children:c}),(0,a.jsx)("div",{className:o().sidePanel,children:(0,a.jsx)(r.ZP,{conversationId:null!=f?f:null,uploadedFiles:S,isMobileWidth:D})}),(0,a.jsx)("div",{className:o().chatBox,children:(0,a.jsx)("div",{className:o().chatBoxBody,children:(0,a.jsx)(i.Suspense,{fallback:(0,a.jsx)(d.Z,{}),children:(0,a.jsx)(p,{conversationId:f,streamedMessages:_,setQueryToProcess:v,isLoggedIn:null!==k,publicConversationSlug:I,chatOptionsData:e,setTitle:h,setUploadedFiles:j,isMobileWidth:D,setImage64:O})})})})]}):(0,a.jsx)("div",{className:o().suggestions,children:"Whoops, nothing to see here!"})}},11930:function(e){e.exports={main:"sharedChat_main__7Nayy",suggestions:"sharedChat_suggestions__V8kr_",inputBox:"sharedChat_inputBox__wRW5A",chatBodyFull:"sharedChat_chatBodyFull__O1MOv",chatBody:"sharedChat_chatBody__OnHDL",chatLayout:"sharedChat_chatLayout__gutlc",chatBox:"sharedChat_chatBox__PmAPg",titleBar:"sharedChat_titleBar__vOHp_",chatBoxBody:"sharedChat_chatBoxBody__ef2Nl",agentIndicator:"sharedChat_agentIndicator__ORCl4"}}},function(e){e.O(0,[7849,647,929,3954,9001,3062,743,121,7071,4051,9984,1603,9417,9178,8423,2697,2971,7023,1744],function(){return e(e.s=91955)}),_N_E=e.O()}]);
|
File without changes
|
File without changes
|
/khoj/interface/compiled/_next/static/chunks/{8423-7f5eb790353afe24.js → 8423-62ac6c832be2461b.js}
RENAMED
File without changes
|
/khoj/interface/compiled/_next/static/chunks/{9417-2e54c6fd056982d8.js → 9417-5d14ac74aaab2c66.js}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|