khoj 1.32.3.dev54__py3-none-any.whl → 1.33.1.dev6__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 +14 -1
- khoj/database/management/commands/change_default_model.py +16 -21
- khoj/interface/compiled/404/index.html +1 -1
- khoj/interface/compiled/_next/static/chunks/app/agents/layout-e00fb81dca656a10.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/agents/{page-3128cbc99e97b41f.js → page-f6f93b8b4457f1f7.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/automations/page-e8f13a995ae7f2fa.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/chat/layout-33934fc2d6ae6838.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/chat/{page-24bd2babb00ef871.js → page-4645a696ec970a94.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/{page-260edf62476e9669.js → page-8ebd7e62c0542aa1.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/search/{page-e1669aa16c662a5d.js → page-bbbfda90fa03c5be.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/settings/{page-4b13801b99e0935b.js → page-1bf10e8d882533b6.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-e8e5db7830bf3f47.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/share/chat/{page-5e452d2692ee2cf0.js → page-3067638b97048e5f.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/webpack-a03962458328b163.js +1 -0
- khoj/interface/compiled/_next/static/css/12f9d6f56a5d8885.css +25 -0
- khoj/interface/compiled/_next/static/css/8e6a3ca11a60b189.css +1 -0
- khoj/interface/compiled/_next/static/css/dac88c17aaee5fcf.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 +3 -3
- khoj/interface/compiled/chat/index.html +1 -1
- khoj/interface/compiled/chat/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 +4 -4
- khoj/interface/compiled/share/chat/index.html +1 -1
- khoj/interface/compiled/share/chat/index.txt +2 -2
- khoj/processor/conversation/prompts.py +37 -17
- khoj/processor/tools/online_search.py +1 -1
- khoj/routers/api.py +23 -20
- khoj/routers/helpers.py +129 -14
- {khoj-1.32.3.dev54.dist-info → khoj-1.33.1.dev6.dist-info}/METADATA +2 -2
- {khoj-1.32.3.dev54.dist-info → khoj-1.33.1.dev6.dist-info}/RECORD +48 -48
- khoj/interface/compiled/_next/static/chunks/app/agents/layout-e49165209d2e406c.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/automations/page-a69f432a177a1cb1.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/chat/layout-d5ae861e1ade9d08.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-95998f0bdc22bb13.js +0 -1
- khoj/interface/compiled/_next/static/chunks/webpack-2e14e2569b58aa67.js +0 -1
- khoj/interface/compiled/_next/static/css/0f0e5dbeda138161.css +0 -1
- khoj/interface/compiled/_next/static/css/5dd9bb87a50b706e.css +0 -25
- khoj/interface/compiled/_next/static/css/bb7461ef275b9b8b.css +0 -1
- /khoj/interface/compiled/_next/static/{cjGfvFwdmUHoj3lMJ1aB3 → OOZqdg9WGuLfQlJSqTPFE}/_buildManifest.js +0 -0
- /khoj/interface/compiled/_next/static/{cjGfvFwdmUHoj3lMJ1aB3 → OOZqdg9WGuLfQlJSqTPFE}/_ssgManifest.js +0 -0
- /khoj/interface/compiled/_next/static/chunks/{182-8cd8b17d40e6e989.js → 182-f1c48a203dc91e0e.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{1915-605f698f2573cfd4.js → 1915-d3c36ad6ce697ce7.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{2117-9886e6a0232dc093.js → 2117-165ef4747a5b836b.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{8667-d3e5bc726e4ff4e3.js → 8667-b6bf63c72b2d76eb.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{9259-27d1ff42af9a43e0.js → 9259-1172dbaca0515237.js} +0 -0
- /khoj/interface/compiled/_next/static/chunks/{9665-1ab5c8c667b74dca.js → 9665-391df1e5c51c960a.js} +0 -0
- {khoj-1.32.3.dev54.dist-info → khoj-1.33.1.dev6.dist-info}/WHEEL +0 -0
- {khoj-1.32.3.dev54.dist-info → khoj-1.33.1.dev6.dist-info}/entry_points.txt +0 -0
- {khoj-1.32.3.dev54.dist-info → khoj-1.33.1.dev6.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
|
|
1
|
-
<!DOCTYPE html><html lang="en" class="__variable_f36179 __variable_702545"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/1d8a05b60287ae6c-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/77c207b095007c34-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/82ef96de0e8f4d8c-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/a6ecd16fa044d500-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/c4250770ab8708b6-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/e098aaaecc9cfbb2-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/089de1d8526b96e9.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/5dd9bb87a50b706e.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/df4b47a2d0d85eae.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/9c164d9727dd8092.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/bb7461ef275b9b8b.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-2e14e2569b58aa67.js"/><script src="/_next/static/chunks/fd9d1056-4482b99a36fd1673.js" async=""></script><script src="/_next/static/chunks/2117-9886e6a0232dc093.js" async=""></script><script src="/_next/static/chunks/main-app-de1f09df97a3cfc7.js" async=""></script><script src="/_next/static/chunks/d3ac728e-44ebd2a0c99b12a0.js" async=""></script><script src="/_next/static/chunks/9259-27d1ff42af9a43e0.js" async=""></script><script src="/_next/static/chunks/8667-d3e5bc726e4ff4e3.js" async=""></script><script src="/_next/static/chunks/182-8cd8b17d40e6e989.js" async=""></script><script src="/_next/static/chunks/1010-8f39bb4648b5ba10.js" async=""></script><script src="/_next/static/chunks/6293-469dd16402ea8a6f.js" async=""></script><script src="/_next/static/chunks/4124-f5c857c57e5391d9.js" async=""></script><script src="/_next/static/chunks/5477-0bbddb79c25a54a7.js" async=""></script><script src="/_next/static/chunks/3789-a09e37a819171a9d.js" async=""></script><script src="/_next/static/chunks/app/share/chat/page-5e452d2692ee2cf0.js" async=""></script><meta http-equiv="Content-Security-Policy" content="default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';"/><meta http-equiv="Content-Security-Policy" content="default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';"/><title>Khoj AI - Ask Anything</title><meta name="description" content="Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents."/><link rel="manifest" href="/static/khoj.webmanifest" crossorigin="use-credentials"/><meta name="keywords" content="research assistant, productivity, AI, Khoj, open source, model agnostic, research, productivity tool, personal assistant, personal research assistant, personal productivity assistant"/><meta property="og:title" content="Khoj AI - Ask Anything"/><meta property="og:description" content="Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents."/><meta property="og:url" content="https://app.khoj.dev/chat/"/><meta property="og:site_name" content="Khoj AI"/><meta property="og:image" content="https://assets.khoj.dev/khoj_hero.png"/><meta property="og:image:width" content="940"/><meta property="og:image:height" content="525"/><meta property="og:image" content="https://assets.khoj.dev/khoj_lantern_256x256.png"/><meta property="og:image:width" content="256"/><meta property="og:image:height" content="256"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:title" content="Khoj AI - Ask Anything"/><meta name="twitter:description" content="Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents."/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_hero.png"/><meta name="twitter:image:width" content="940"/><meta name="twitter:image:height" content="525"/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_lantern_256x256.png"/><meta name="twitter:image:width" content="256"/><meta name="twitter:image:height" content="256"/><link rel="icon" href="/static/assets/icons/khoj_lantern.ico"/><link rel="apple-touch-icon" href="/static/assets/icons/khoj_lantern_256x256.png"/><meta name="next-size-adjust"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><html lang="en" class="__variable_f36179 __variable_702545"><body><div class="bg-background opacity-50 flex items-center justify-center h-screen"><div>Loading<!-- --> <span><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 256 256" class="inline animate-spin h-5 w-5"><path d="M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"></path></svg></span></div></div><script>window.EXCALIDRAW_ASSET_PATH = 'https://assets.khoj.dev/@excalidraw/excalidraw/dist/';</script><script src="/_next/static/chunks/webpack-2e14e2569b58aa67.js" async=""></script></body></html><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/1d8a05b60287ae6c-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/media/77c207b095007c34-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n3:HL[\"/_next/static/media/82ef96de0e8f4d8c-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n4:HL[\"/_next/static/media/a6ecd16fa044d500-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n5:HL[\"/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n6:HL[\"/_next/static/media/c4250770ab8708b6-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n7:HL[\"/_next/static/media/e098aaaecc9cfbb2-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n8:HL[\"/_next/static/css/089de1d8526b96e9.css\",\"style\"]\n9:HL[\"/_next/static/css/5dd9bb87a50b706e.css\",\"style\"]\na:HL[\"/_next/static/css/df4b47a2d0d85eae.css\",\"style\"]\nb:HL[\"/_next/static/css/9c164d9727dd8092.css\",\"style\"]\nc:HL[\"/_next/static/css/bb7461ef275b9b8b.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"d:I[12846,[],\"\"]\nf:I[19107,[],\"ClientPageRoot\"]\n10:I[41694,[\"3954\",\"static/chunks/d3ac728e-44ebd2a0c99b12a0.js\",\"9259\",\"static/chunks/9259-27d1ff42af9a43e0.js\",\"8667\",\"static/chunks/8667-d3e5bc726e4ff4e3.js\",\"182\",\"static/chunks/182-8cd8b17d40e6e989.js\",\"1010\",\"static/chunks/1010-8f39bb4648b5ba10.js\",\"6293\",\"static/chunks/6293-469dd16402ea8a6f.js\",\"4124\",\"static/chunks/4124-f5c857c57e5391d9.js\",\"5477\",\"static/chunks/5477-0bbddb79c25a54a7.js\",\"3789\",\"static/chunks/3789-a09e37a819171a9d.js\",\"3111\",\"static/chunks/app/share/chat/page-5e452d2692ee2cf0.js\"],\"default\",1]\n11:I[4707,[],\"\"]\n12:I[36423,[],\"\"]\n14:I[61060,[],\"\"]\n15:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$Ld\",null,{\"buildId\":\"cjGfvFwdmUHoj3lMJ1aB3\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"share\",\"chat\",\"\"],\"initialTree\":[\"\",{\"children\":[\"share\",{\"children\":[\"chat\",{\"children\":[\"__PAGE__\",{}]}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"share\",{\"children\":[\"chat\",{\"children\":[\"__PAGE__\",{},[[\"$Le\",[\"$\",\"$Lf\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$10\"}],[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/df4b47a2d0d85eae.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/9c164d9727dd8092.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/bb7461ef275b9b8b.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]]],null],null]},[[null,[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"__variable_f36179 __variable_702545\",\"children\":[[\"$\",\"meta\",null,{\"httpEquiv\":\"Content-Security-Policy\",\"content\":\"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';\"}],[\"$\",\"body\",null,{\"children\":[[\"$\",\"$L11\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"share\",\"children\",\"chat\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L12\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}],[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"window.EXCALIDRAW_ASSET_PATH = 'https://assets.khoj.dev/@excalidraw/excalidraw/dist/';\"}}]]}]]}]],null],null]},[null,[\"$\",\"$L11\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"share\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L12\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/089de1d8526b96e9.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/5dd9bb87a50b706e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"__variable_f36179 __variable_702545\",\"children\":[[\"$\",\"meta\",null,{\"httpEquiv\":\"Content-Security-Policy\",\"content\":\"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';\"}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L11\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L12\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$L13\"],\"globalErrorComponent\":\"$14\",\"missingSlots\":\"$W15\"}]\n"])</script><script>self.__next_f.push([1,"13:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Khoj AI - Ask Anything\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents.\"}],[\"$\",\"link\",\"4\",{\"rel\":\"manifest\",\"href\":\"/static/khoj.webmanifest\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"5\",{\"name\":\"keywords\",\"content\":\"research assistant, productivity, AI, Khoj, open source, model agnostic, research, productivity tool, personal assistant, personal research assistant, personal productivity assistant\"}],[\"$\",\"meta\",\"6\",{\"property\":\"og:title\",\"content\":\"Khoj AI - Ask Anything\"}],[\"$\",\"meta\",\"7\",{\"property\":\"og:description\",\"content\":\"Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents.\"}],[\"$\",\"meta\",\"8\",{\"property\":\"og:url\",\"content\":\"https://app.khoj.dev/chat/\"}],[\"$\",\"meta\",\"9\",{\"property\":\"og:site_name\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"10\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_hero.png\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:image:width\",\"content\":\"940\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:image:height\",\"content\":\"525\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:title\",\"content\":\"Khoj AI - Ask Anything\"}],[\"$\",\"meta\",\"19\",{\"name\":\"twitter:description\",\"content\":\"Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents.\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_hero.png\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:image:width\",\"content\":\"940\"}],[\"$\",\"meta\",\"22\",{\"name\":\"twitter:image:height\",\"content\":\"525\"}],[\"$\",\"meta\",\"23\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"24\",{\"name\":\"twitter:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"25\",{\"name\":\"twitter:image:height\",\"content\":\"256\"}],[\"$\",\"link\",\"26\",{\"rel\":\"icon\",\"href\":\"/static/assets/icons/khoj_lantern.ico\"}],[\"$\",\"link\",\"27\",{\"rel\":\"apple-touch-icon\",\"href\":\"/static/assets/icons/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"28\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"e:null\n"])</script></body></html>
|
1
|
+
<!DOCTYPE html><html lang="en" class="__variable_f36179 __variable_702545"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/1d8a05b60287ae6c-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/77c207b095007c34-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/82ef96de0e8f4d8c-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/a6ecd16fa044d500-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/c4250770ab8708b6-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/e098aaaecc9cfbb2-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/089de1d8526b96e9.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/12f9d6f56a5d8885.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/df4b47a2d0d85eae.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/9c164d9727dd8092.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/8e6a3ca11a60b189.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-a03962458328b163.js"/><script src="/_next/static/chunks/fd9d1056-4482b99a36fd1673.js" async=""></script><script src="/_next/static/chunks/2117-165ef4747a5b836b.js" async=""></script><script src="/_next/static/chunks/main-app-de1f09df97a3cfc7.js" async=""></script><script src="/_next/static/chunks/d3ac728e-44ebd2a0c99b12a0.js" async=""></script><script src="/_next/static/chunks/9259-1172dbaca0515237.js" async=""></script><script src="/_next/static/chunks/8667-b6bf63c72b2d76eb.js" async=""></script><script src="/_next/static/chunks/182-f1c48a203dc91e0e.js" async=""></script><script src="/_next/static/chunks/1010-8f39bb4648b5ba10.js" async=""></script><script src="/_next/static/chunks/6293-469dd16402ea8a6f.js" async=""></script><script src="/_next/static/chunks/4124-f5c857c57e5391d9.js" async=""></script><script src="/_next/static/chunks/5477-0bbddb79c25a54a7.js" async=""></script><script src="/_next/static/chunks/3789-a09e37a819171a9d.js" async=""></script><script src="/_next/static/chunks/app/share/chat/page-3067638b97048e5f.js" async=""></script><meta http-equiv="Content-Security-Policy" content="default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';"/><meta http-equiv="Content-Security-Policy" content="default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';"/><title>Khoj AI - Ask Anything</title><meta name="description" content="Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents."/><link rel="manifest" href="/static/khoj.webmanifest" crossorigin="use-credentials"/><meta name="keywords" content="research assistant, productivity, AI, Khoj, open source, model agnostic, research, productivity tool, personal assistant, personal research assistant, personal productivity assistant"/><meta property="og:title" content="Khoj AI - Ask Anything"/><meta property="og:description" content="Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents."/><meta property="og:url" content="https://app.khoj.dev/chat/"/><meta property="og:site_name" content="Khoj AI"/><meta property="og:image" content="https://assets.khoj.dev/khoj_hero.png"/><meta property="og:image:width" content="940"/><meta property="og:image:height" content="525"/><meta property="og:image" content="https://assets.khoj.dev/khoj_lantern_256x256.png"/><meta property="og:image:width" content="256"/><meta property="og:image:height" content="256"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:title" content="Khoj AI - Ask Anything"/><meta name="twitter:description" content="Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents."/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_hero.png"/><meta name="twitter:image:width" content="940"/><meta name="twitter:image:height" content="525"/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_lantern_256x256.png"/><meta name="twitter:image:width" content="256"/><meta name="twitter:image:height" content="256"/><link rel="icon" href="/static/assets/icons/khoj_lantern.ico"/><link rel="apple-touch-icon" href="/static/assets/icons/khoj_lantern_256x256.png"/><meta name="next-size-adjust"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><html lang="en" class="__variable_f36179 __variable_702545"><body><div class="bg-background opacity-50 flex items-center justify-center h-screen"><div>Loading<!-- --> <span><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" viewBox="0 0 256 256" class="inline animate-spin h-5 w-5"><path d="M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"></path></svg></span></div></div><script>window.EXCALIDRAW_ASSET_PATH = 'https://assets.khoj.dev/@excalidraw/excalidraw/dist/';</script><script src="/_next/static/chunks/webpack-a03962458328b163.js" async=""></script></body></html><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/1d8a05b60287ae6c-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/media/77c207b095007c34-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n3:HL[\"/_next/static/media/82ef96de0e8f4d8c-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n4:HL[\"/_next/static/media/a6ecd16fa044d500-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n5:HL[\"/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n6:HL[\"/_next/static/media/c4250770ab8708b6-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n7:HL[\"/_next/static/media/e098aaaecc9cfbb2-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n8:HL[\"/_next/static/css/089de1d8526b96e9.css\",\"style\"]\n9:HL[\"/_next/static/css/12f9d6f56a5d8885.css\",\"style\"]\na:HL[\"/_next/static/css/df4b47a2d0d85eae.css\",\"style\"]\nb:HL[\"/_next/static/css/9c164d9727dd8092.css\",\"style\"]\nc:HL[\"/_next/static/css/8e6a3ca11a60b189.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"d:I[12846,[],\"\"]\nf:I[19107,[],\"ClientPageRoot\"]\n10:I[41694,[\"3954\",\"static/chunks/d3ac728e-44ebd2a0c99b12a0.js\",\"9259\",\"static/chunks/9259-1172dbaca0515237.js\",\"8667\",\"static/chunks/8667-b6bf63c72b2d76eb.js\",\"182\",\"static/chunks/182-f1c48a203dc91e0e.js\",\"1010\",\"static/chunks/1010-8f39bb4648b5ba10.js\",\"6293\",\"static/chunks/6293-469dd16402ea8a6f.js\",\"4124\",\"static/chunks/4124-f5c857c57e5391d9.js\",\"5477\",\"static/chunks/5477-0bbddb79c25a54a7.js\",\"3789\",\"static/chunks/3789-a09e37a819171a9d.js\",\"3111\",\"static/chunks/app/share/chat/page-3067638b97048e5f.js\"],\"default\",1]\n11:I[4707,[],\"\"]\n12:I[36423,[],\"\"]\n14:I[61060,[],\"\"]\n15:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$Ld\",null,{\"buildId\":\"OOZqdg9WGuLfQlJSqTPFE\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"share\",\"chat\",\"\"],\"initialTree\":[\"\",{\"children\":[\"share\",{\"children\":[\"chat\",{\"children\":[\"__PAGE__\",{}]}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"share\",{\"children\":[\"chat\",{\"children\":[\"__PAGE__\",{},[[\"$Le\",[\"$\",\"$Lf\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$10\"}],[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/df4b47a2d0d85eae.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/9c164d9727dd8092.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/8e6a3ca11a60b189.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]]],null],null]},[[null,[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"__variable_f36179 __variable_702545\",\"children\":[[\"$\",\"meta\",null,{\"httpEquiv\":\"Content-Security-Policy\",\"content\":\"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';\"}],[\"$\",\"body\",null,{\"children\":[[\"$\",\"$L11\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"share\",\"children\",\"chat\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L12\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}],[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"window.EXCALIDRAW_ASSET_PATH = 'https://assets.khoj.dev/@excalidraw/excalidraw/dist/';\"}}]]}]]}]],null],null]},[null,[\"$\",\"$L11\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"share\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L12\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/089de1d8526b96e9.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/12f9d6f56a5d8885.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"__variable_f36179 __variable_702545\",\"children\":[[\"$\",\"meta\",null,{\"httpEquiv\":\"Content-Security-Policy\",\"content\":\"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';\"}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L11\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L12\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$L13\"],\"globalErrorComponent\":\"$14\",\"missingSlots\":\"$W15\"}]\n"])</script><script>self.__next_f.push([1,"13:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Khoj AI - Ask Anything\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents.\"}],[\"$\",\"link\",\"4\",{\"rel\":\"manifest\",\"href\":\"/static/khoj.webmanifest\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"5\",{\"name\":\"keywords\",\"content\":\"research assistant, productivity, AI, Khoj, open source, model agnostic, research, productivity tool, personal assistant, personal research assistant, personal productivity assistant\"}],[\"$\",\"meta\",\"6\",{\"property\":\"og:title\",\"content\":\"Khoj AI - Ask Anything\"}],[\"$\",\"meta\",\"7\",{\"property\":\"og:description\",\"content\":\"Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents.\"}],[\"$\",\"meta\",\"8\",{\"property\":\"og:url\",\"content\":\"https://app.khoj.dev/chat/\"}],[\"$\",\"meta\",\"9\",{\"property\":\"og:site_name\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"10\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_hero.png\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:image:width\",\"content\":\"940\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:image:height\",\"content\":\"525\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"16\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:title\",\"content\":\"Khoj AI - Ask Anything\"}],[\"$\",\"meta\",\"19\",{\"name\":\"twitter:description\",\"content\":\"Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents.\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_hero.png\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:image:width\",\"content\":\"940\"}],[\"$\",\"meta\",\"22\",{\"name\":\"twitter:image:height\",\"content\":\"525\"}],[\"$\",\"meta\",\"23\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"24\",{\"name\":\"twitter:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"25\",{\"name\":\"twitter:image:height\",\"content\":\"256\"}],[\"$\",\"link\",\"26\",{\"rel\":\"icon\",\"href\":\"/static/assets/icons/khoj_lantern.ico\"}],[\"$\",\"link\",\"27\",{\"rel\":\"apple-touch-icon\",\"href\":\"/static/assets/icons/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"28\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"e:null\n"])</script></body></html>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
2:I[19107,[],"ClientPageRoot"]
|
2
|
-
3:I[41694,["3954","static/chunks/d3ac728e-44ebd2a0c99b12a0.js","9259","static/chunks/9259-
|
2
|
+
3:I[41694,["3954","static/chunks/d3ac728e-44ebd2a0c99b12a0.js","9259","static/chunks/9259-1172dbaca0515237.js","8667","static/chunks/8667-b6bf63c72b2d76eb.js","182","static/chunks/182-f1c48a203dc91e0e.js","1010","static/chunks/1010-8f39bb4648b5ba10.js","6293","static/chunks/6293-469dd16402ea8a6f.js","4124","static/chunks/4124-f5c857c57e5391d9.js","5477","static/chunks/5477-0bbddb79c25a54a7.js","3789","static/chunks/3789-a09e37a819171a9d.js","3111","static/chunks/app/share/chat/page-3067638b97048e5f.js"],"default",1]
|
3
3
|
4:I[4707,[],""]
|
4
4
|
5:I[36423,[],""]
|
5
|
-
0:["
|
5
|
+
0:["OOZqdg9WGuLfQlJSqTPFE",[[["",{"children":["share",{"children":["chat",{"children":["__PAGE__",{}]}]}]},"$undefined","$undefined",true],["",{"children":["share",{"children":["chat",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/df4b47a2d0d85eae.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/9c164d9727dd8092.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","2",{"rel":"stylesheet","href":"/_next/static/css/8e6a3ca11a60b189.css","precedence":"next","crossOrigin":"$undefined"}]]],null],null]},[[null,["$","html",null,{"lang":"en","className":"__variable_f36179 __variable_702545","children":[["$","meta",null,{"httpEquiv":"Content-Security-Policy","content":"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';"}],["$","body",null,{"children":[["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","share","children","chat","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}],["$","script",null,{"dangerouslySetInnerHTML":{"__html":"window.EXCALIDRAW_ASSET_PATH = 'https://assets.khoj.dev/@excalidraw/excalidraw/dist/';"}}]]}]]}]],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","share","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/089de1d8526b96e9.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/12f9d6f56a5d8885.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","className":"__variable_f36179 __variable_702545","children":[["$","meta",null,{"httpEquiv":"Content-Security-Policy","content":"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev https://app.chatwoot.com https://accounts.google.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110 https://accounts.google.com; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com https://accounts.google.com; img-src 'self' data: blob: https://*.khoj.dev https://accounts.google.com https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; frame-src 'self' https://accounts.google.com https://app.chatwoot.com; child-src 'self' https://app.chatwoot.com; object-src 'none';"}],["$","body",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]]}]],null],null],["$L6",null]]]]
|
6
6
|
6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Khoj AI - Ask Anything"}],["$","meta","3",{"name":"description","content":"Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents."}],["$","link","4",{"rel":"manifest","href":"/static/khoj.webmanifest","crossOrigin":"use-credentials"}],["$","meta","5",{"name":"keywords","content":"research assistant, productivity, AI, Khoj, open source, model agnostic, research, productivity tool, personal assistant, personal research assistant, personal productivity assistant"}],["$","meta","6",{"property":"og:title","content":"Khoj AI - Ask Anything"}],["$","meta","7",{"property":"og:description","content":"Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents."}],["$","meta","8",{"property":"og:url","content":"https://app.khoj.dev/chat/"}],["$","meta","9",{"property":"og:site_name","content":"Khoj AI"}],["$","meta","10",{"property":"og:image","content":"https://assets.khoj.dev/khoj_hero.png"}],["$","meta","11",{"property":"og:image:width","content":"940"}],["$","meta","12",{"property":"og:image:height","content":"525"}],["$","meta","13",{"property":"og:image","content":"https://assets.khoj.dev/khoj_lantern_256x256.png"}],["$","meta","14",{"property":"og:image:width","content":"256"}],["$","meta","15",{"property":"og:image:height","content":"256"}],["$","meta","16",{"property":"og:type","content":"website"}],["$","meta","17",{"name":"twitter:card","content":"summary_large_image"}],["$","meta","18",{"name":"twitter:title","content":"Khoj AI - Ask Anything"}],["$","meta","19",{"name":"twitter:description","content":"Ask anything. Research answers from across the internet and your documents, draft messages, summarize documents, generate paintings and chat with personal agents."}],["$","meta","20",{"name":"twitter:image","content":"https://assets.khoj.dev/khoj_hero.png"}],["$","meta","21",{"name":"twitter:image:width","content":"940"}],["$","meta","22",{"name":"twitter:image:height","content":"525"}],["$","meta","23",{"name":"twitter:image","content":"https://assets.khoj.dev/khoj_lantern_256x256.png"}],["$","meta","24",{"name":"twitter:image:width","content":"256"}],["$","meta","25",{"name":"twitter:image:height","content":"256"}],["$","link","26",{"rel":"icon","href":"/static/assets/icons/khoj_lantern.ico"}],["$","link","27",{"rel":"apple-touch-icon","href":"/static/assets/icons/khoj_lantern_256x256.png"}],["$","meta","28",{"name":"next-size-adjust"}]]
|
7
7
|
1:null
|
@@ -935,7 +935,7 @@ AI: Here is one I found: "It's not denial. I'm just selective about the reality
|
|
935
935
|
User: Hahah, nice! Show a new one every morning.
|
936
936
|
Khoj: {{
|
937
937
|
"crontime": "0 9 * * *",
|
938
|
-
"query": "
|
938
|
+
"query": "Share a funny Calvin and Hobbes or Bill Watterson quote from my notes",
|
939
939
|
"subject": "Your Calvin and Hobbes Quote for the Day"
|
940
940
|
}}
|
941
941
|
|
@@ -955,7 +955,7 @@ AI: The latest released Khoj python package version is 1.5.0.
|
|
955
955
|
User: Notify me when version 2.0.0 is released
|
956
956
|
Khoj: {{
|
957
957
|
"crontime": "0 10 * * *",
|
958
|
-
"query": "/automated_task What is the latest released version of the Khoj python package?",
|
958
|
+
"query": "/automated_task /research What is the latest released version of the Khoj python package?",
|
959
959
|
"subject": "Khoj Python Package Version 2.0.0 Release"
|
960
960
|
}}
|
961
961
|
|
@@ -1101,33 +1101,33 @@ to_notify_or_not = PromptTemplate.from_template(
|
|
1101
1101
|
You are Khoj, an extremely smart and discerning notification assistant.
|
1102
1102
|
- Decide whether the user should be notified of the AI's response using the Original User Query, Executed User Query and AI Response triplet.
|
1103
1103
|
- Notify the user only if the AI's response satisfies the user specified requirements.
|
1104
|
-
- You should
|
1104
|
+
- You should return a response with your reason and "Yes" or "No" decision in JSON format. Do not say anything else.
|
1105
1105
|
|
1106
1106
|
# Examples:
|
1107
1107
|
Original User Query: Hahah, nice! Show a new one every morning at 9am. My Current Location: Shanghai, China
|
1108
1108
|
Executed User Query: Could you share a funny Calvin and Hobbes quote from my notes?
|
1109
1109
|
AI Reponse: Here is one I found: "It's not denial. I'm just selective about the reality I accept."
|
1110
|
-
Khoj: Yes
|
1110
|
+
Khoj: {{ "reason": "The AI has shared a funny Calvin and Hobbes quote." , "decision": "Yes" }}
|
1111
1111
|
|
1112
1112
|
Original User Query: Every evening check if it's going to rain tomorrow. Notify me only if I'll need an umbrella. My Current Location: Nairobi, Kenya
|
1113
1113
|
Executed User Query: Is it going to rain tomorrow in Nairobi, Kenya
|
1114
1114
|
AI Response: Tomorrow's forecast is sunny with a high of 28°C and a low of 18°C
|
1115
|
-
Khoj: No
|
1115
|
+
Khoj: {{ "reason": "It is not expected to rain tomorrow.", "decision": "No" }}
|
1116
1116
|
|
1117
|
-
Original User Query:
|
1118
|
-
Executed User Query:
|
1119
|
-
AI Response: The latest released Khoj python package version is 1.5.0.
|
1120
|
-
Khoj: No
|
1121
|
-
|
1122
|
-
Original User Query: Paint me a sunset every evening. My Current Location: Shanghai, China
|
1123
|
-
Executed User Query: Paint me a sunset in Shanghai, China
|
1117
|
+
Original User Query: Paint a sunset for me every evening. My Current Location: Shanghai, China
|
1118
|
+
Executed User Query: Paint a sunset in Shanghai, China
|
1124
1119
|
AI Response: https://khoj-generated-images.khoj.dev/user110/image78124.webp
|
1125
|
-
Khoj: Yes
|
1120
|
+
Khoj: {{ "reason": "The AI has created an image.", "decision": "Yes" }}
|
1121
|
+
|
1122
|
+
Original User Query: Notify me when Khoj version 2.0.0 is released
|
1123
|
+
Executed User Query: What is the latest released version of the Khoj python package
|
1124
|
+
AI Response: The latest released Khoj python package version is 1.5.0.
|
1125
|
+
Khoj: {{ "reason": "Version 2.0.0 of Khoj has not been released yet." , "decision": "No" }}
|
1126
1126
|
|
1127
|
-
Original User Query: Share a summary of the tasks I've completed at the end of the day.
|
1128
|
-
Executed User Query:
|
1129
|
-
AI Response:
|
1130
|
-
Khoj:
|
1127
|
+
Original User Query: Share a summary of the tasks I've completed at the end of the day.
|
1128
|
+
Executed User Query: Generate a summary of the tasks I've completed today.
|
1129
|
+
AI Response: You have completed the following tasks today: 1. Meeting with the team 2. Submit travel expense report
|
1130
|
+
Khoj: {{ "reason": "The AI has provided a summary of completed tasks.", "decision": "Yes" }}
|
1131
1131
|
|
1132
1132
|
Original User Query: {original_query}
|
1133
1133
|
Executed User Query: {executed_query}
|
@@ -1137,6 +1137,26 @@ Khoj:
|
|
1137
1137
|
)
|
1138
1138
|
|
1139
1139
|
|
1140
|
+
automation_format_prompt = PromptTemplate.from_template(
|
1141
|
+
"""
|
1142
|
+
You are Khoj, a smart and creative researcher and writer with a knack for creating engaging content.
|
1143
|
+
- You *CAN REMEMBER ALL NOTES and PERSONAL INFORMATION FOREVER* that the user ever shares with you.
|
1144
|
+
- You *CAN* generate look-up real-time information from the internet, send notifications and answer questions based on the user's notes.
|
1145
|
+
|
1146
|
+
Convert the AI response into a clear, structured markdown report with section headings to improve readability.
|
1147
|
+
Your response will be sent in the body of an email to the user.
|
1148
|
+
Do not add an email subject. Never add disclaimers in your final response.
|
1149
|
+
|
1150
|
+
You are provided the following details for context.
|
1151
|
+
|
1152
|
+
{username}
|
1153
|
+
Original User Query: {original_query}
|
1154
|
+
Executed Chat Request: {executed_query}
|
1155
|
+
AI Response: {response}
|
1156
|
+
Khoj:
|
1157
|
+
""".strip()
|
1158
|
+
)
|
1159
|
+
|
1140
1160
|
# System messages to user
|
1141
1161
|
# --
|
1142
1162
|
help_message = PromptTemplate.from_template(
|
@@ -40,7 +40,7 @@ FIRECRAWL_USE_LLM_EXTRACT = is_env_var_true("FIRECRAWL_USE_LLM_EXTRACT")
|
|
40
40
|
|
41
41
|
OLOSTEP_QUERY_PARAMS = {
|
42
42
|
"timeout": 35, # seconds
|
43
|
-
"waitBeforeScraping":
|
43
|
+
"waitBeforeScraping": 0, # seconds
|
44
44
|
"saveHtml": "False",
|
45
45
|
"saveMarkdown": "True",
|
46
46
|
"removeCSSselectors": "default",
|
khoj/routers/api.py
CHANGED
@@ -38,15 +38,15 @@ from khoj.processor.conversation.offline.chat_model import extract_questions_off
|
|
38
38
|
from khoj.processor.conversation.offline.whisper import transcribe_audio_offline
|
39
39
|
from khoj.processor.conversation.openai.gpt import extract_questions
|
40
40
|
from khoj.processor.conversation.openai.whisper import transcribe_audio
|
41
|
-
from khoj.processor.conversation.utils import defilter_query
|
41
|
+
from khoj.processor.conversation.utils import clean_json, defilter_query
|
42
42
|
from khoj.routers.helpers import (
|
43
43
|
ApiUserRateLimiter,
|
44
44
|
ChatEvent,
|
45
45
|
CommonQueryParams,
|
46
46
|
ConversationCommandRateLimiter,
|
47
|
-
acreate_title_from_query,
|
48
47
|
get_user_config,
|
49
48
|
schedule_automation,
|
49
|
+
schedule_query,
|
50
50
|
update_telemetry_state,
|
51
51
|
)
|
52
52
|
from khoj.search_filter.date_filter import DateFilter
|
@@ -566,7 +566,7 @@ def delete_automation(request: Request, automation_id: str) -> Response:
|
|
566
566
|
|
567
567
|
@api.post("/automation", response_class=Response)
|
568
568
|
@requires(["authenticated"])
|
569
|
-
|
569
|
+
def post_automation(
|
570
570
|
request: Request,
|
571
571
|
q: str,
|
572
572
|
crontime: str,
|
@@ -584,11 +584,15 @@ async def post_automation(
|
|
584
584
|
if not cron_descriptor.get_description(crontime):
|
585
585
|
return Response(content="Invalid crontime", status_code=400)
|
586
586
|
|
587
|
+
# Infer subject, query to run
|
588
|
+
_, query_to_run, generated_subject = schedule_query(q, conversation_history={}, user=user)
|
589
|
+
subject = subject or generated_subject
|
590
|
+
|
587
591
|
# Normalize query parameters
|
588
592
|
# Add /automated_task prefix to query if not present
|
589
|
-
|
590
|
-
if not
|
591
|
-
query_to_run = f"/automated_task {
|
593
|
+
query_to_run = query_to_run.strip()
|
594
|
+
if not query_to_run.startswith("/automated_task"):
|
595
|
+
query_to_run = f"/automated_task {query_to_run}"
|
592
596
|
|
593
597
|
# Normalize crontime for AP Scheduler CronTrigger
|
594
598
|
crontime = crontime.strip()
|
@@ -603,24 +607,19 @@ async def post_automation(
|
|
603
607
|
minute_value = crontime.split(" ")[0]
|
604
608
|
if not minute_value.isdigit():
|
605
609
|
return Response(
|
606
|
-
content="
|
610
|
+
content="Minute level recurrence is unsupported. Please create a less frequent schedule.",
|
607
611
|
status_code=400,
|
608
612
|
)
|
609
613
|
|
610
|
-
if not subject:
|
611
|
-
subject = await acreate_title_from_query(q, user)
|
612
|
-
|
613
|
-
title = f"Automation: {subject}"
|
614
|
-
|
615
614
|
# Create new Conversation Session associated with this new task
|
616
|
-
|
617
|
-
|
618
|
-
calling_url = request.url.replace(query=f"{request.url.query}")
|
615
|
+
title = f"Automation: {subject}"
|
616
|
+
conversation = ConversationAdapters.create_conversation_session(user, request.user.client_app, title=title)
|
619
617
|
|
620
618
|
# Schedule automation with query_to_run, timezone, subject directly provided by user
|
621
619
|
try:
|
622
620
|
# Use the query to run as the scheduling request if the scheduling request is unset
|
623
|
-
|
621
|
+
calling_url = request.url.replace(query=f"{request.url.query}")
|
622
|
+
automation = schedule_automation(
|
624
623
|
query_to_run, subject, crontime, timezone, q, user, calling_url, str(conversation.id)
|
625
624
|
)
|
626
625
|
except Exception as e:
|
@@ -691,11 +690,15 @@ def edit_job(
|
|
691
690
|
logger.error(f"Error editing automation {automation_id} for {user.email}: {e}", exc_info=True)
|
692
691
|
return Response(content="Invalid automation", status_code=403)
|
693
692
|
|
693
|
+
# Infer subject, query to run
|
694
|
+
_, query_to_run, _ = schedule_query(q, conversation_history={}, user=user)
|
695
|
+
subject = subject
|
696
|
+
|
694
697
|
# Normalize query parameters
|
695
698
|
# Add /automated_task prefix to query if not present
|
696
|
-
|
697
|
-
if not
|
698
|
-
query_to_run = f"/automated_task {
|
699
|
+
query_to_run = query_to_run.strip()
|
700
|
+
if not query_to_run.startswith("/automated_task"):
|
701
|
+
query_to_run = f"/automated_task {query_to_run}"
|
699
702
|
# Normalize crontime for AP Scheduler CronTrigger
|
700
703
|
crontime = crontime.strip()
|
701
704
|
if len(crontime.split(" ")) > 5:
|
@@ -713,7 +716,7 @@ def edit_job(
|
|
713
716
|
)
|
714
717
|
|
715
718
|
# Construct updated automation metadata
|
716
|
-
automation_metadata = json.loads(automation.name)
|
719
|
+
automation_metadata: dict[str, str] = json.loads(clean_json(automation.name))
|
717
720
|
automation_metadata["scheduling_request"] = q
|
718
721
|
automation_metadata["query_to_run"] = query_to_run
|
719
722
|
automation_metadata["subject"] = subject.strip()
|
khoj/routers/helpers.py
CHANGED
@@ -325,7 +325,7 @@ async def acheck_if_safe_prompt(system_prompt: str, user: KhojUser = None, lax:
|
|
325
325
|
|
326
326
|
response = response.strip()
|
327
327
|
try:
|
328
|
-
response = clean_json(response)
|
328
|
+
response = json.loads(clean_json(response))
|
329
329
|
is_safe = response.get("safe", "True") == "True"
|
330
330
|
if not is_safe:
|
331
331
|
reason = response.get("reason", "")
|
@@ -551,9 +551,37 @@ async def generate_online_subqueries(
|
|
551
551
|
return {q}
|
552
552
|
|
553
553
|
|
554
|
-
|
554
|
+
def schedule_query(
|
555
555
|
q: str, conversation_history: dict, user: KhojUser, query_images: List[str] = None, tracer: dict = {}
|
556
|
-
) -> Tuple[str,
|
556
|
+
) -> Tuple[str, str, str]:
|
557
|
+
"""
|
558
|
+
Schedule the date, time to run the query. Assume the server timezone is UTC.
|
559
|
+
"""
|
560
|
+
chat_history = construct_chat_history(conversation_history)
|
561
|
+
|
562
|
+
crontime_prompt = prompts.crontime_prompt.format(
|
563
|
+
query=q,
|
564
|
+
chat_history=chat_history,
|
565
|
+
)
|
566
|
+
|
567
|
+
raw_response = send_message_to_model_wrapper_sync(
|
568
|
+
crontime_prompt, query_images=query_images, response_type="json_object", user=user, tracer=tracer
|
569
|
+
)
|
570
|
+
|
571
|
+
# Validate that the response is a non-empty, JSON-serializable list
|
572
|
+
try:
|
573
|
+
raw_response = raw_response.strip()
|
574
|
+
response: Dict[str, str] = json.loads(clean_json(raw_response))
|
575
|
+
if not response or not isinstance(response, Dict) or len(response) != 3:
|
576
|
+
raise AssertionError(f"Invalid response for scheduling query : {response}")
|
577
|
+
return response.get("crontime"), response.get("query"), response.get("subject")
|
578
|
+
except Exception:
|
579
|
+
raise AssertionError(f"Invalid response for scheduling query: {raw_response}")
|
580
|
+
|
581
|
+
|
582
|
+
async def aschedule_query(
|
583
|
+
q: str, conversation_history: dict, user: KhojUser, query_images: List[str] = None, tracer: dict = {}
|
584
|
+
) -> Tuple[str, str, str]:
|
557
585
|
"""
|
558
586
|
Schedule the date, time to run the query. Assume the server timezone is UTC.
|
559
587
|
"""
|
@@ -571,7 +599,7 @@ async def schedule_query(
|
|
571
599
|
# Validate that the response is a non-empty, JSON-serializable list
|
572
600
|
try:
|
573
601
|
raw_response = raw_response.strip()
|
574
|
-
response: Dict[str, str] = json.loads(raw_response)
|
602
|
+
response: Dict[str, str] = json.loads(clean_json(raw_response))
|
575
603
|
if not response or not isinstance(response, Dict) or len(response) != 3:
|
576
604
|
raise AssertionError(f"Invalid response for scheduling query : {response}")
|
577
605
|
return response.get("crontime"), response.get("query"), response.get("subject")
|
@@ -1065,6 +1093,7 @@ def send_message_to_model_wrapper_sync(
|
|
1065
1093
|
system_message: str = "",
|
1066
1094
|
response_type: str = "text",
|
1067
1095
|
user: KhojUser = None,
|
1096
|
+
query_images: List[str] = None,
|
1068
1097
|
query_files: str = "",
|
1069
1098
|
tracer: dict = {},
|
1070
1099
|
):
|
@@ -1090,6 +1119,7 @@ def send_message_to_model_wrapper_sync(
|
|
1090
1119
|
max_prompt_size=max_tokens,
|
1091
1120
|
vision_enabled=vision_available,
|
1092
1121
|
model_type=chat_model.model_type,
|
1122
|
+
query_images=query_images,
|
1093
1123
|
query_files=query_files,
|
1094
1124
|
)
|
1095
1125
|
|
@@ -1112,6 +1142,7 @@ def send_message_to_model_wrapper_sync(
|
|
1112
1142
|
max_prompt_size=max_tokens,
|
1113
1143
|
vision_enabled=vision_available,
|
1114
1144
|
model_type=chat_model.model_type,
|
1145
|
+
query_images=query_images,
|
1115
1146
|
query_files=query_files,
|
1116
1147
|
)
|
1117
1148
|
|
@@ -1134,6 +1165,7 @@ def send_message_to_model_wrapper_sync(
|
|
1134
1165
|
max_prompt_size=max_tokens,
|
1135
1166
|
vision_enabled=vision_available,
|
1136
1167
|
model_type=chat_model.model_type,
|
1168
|
+
query_images=query_images,
|
1137
1169
|
query_files=query_files,
|
1138
1170
|
)
|
1139
1171
|
|
@@ -1154,6 +1186,7 @@ def send_message_to_model_wrapper_sync(
|
|
1154
1186
|
max_prompt_size=max_tokens,
|
1155
1187
|
vision_enabled=vision_available,
|
1156
1188
|
model_type=chat_model.model_type,
|
1189
|
+
query_images=query_images,
|
1157
1190
|
query_files=query_files,
|
1158
1191
|
)
|
1159
1192
|
|
@@ -1634,6 +1667,25 @@ class CommonQueryParamsClass:
|
|
1634
1667
|
CommonQueryParams = Annotated[CommonQueryParamsClass, Depends()]
|
1635
1668
|
|
1636
1669
|
|
1670
|
+
def format_automation_response(scheduling_request: str, executed_query: str, ai_response: str, user: KhojUser) -> bool:
|
1671
|
+
"""
|
1672
|
+
Format the AI response to send in automation email to user.
|
1673
|
+
"""
|
1674
|
+
name = get_user_name(user)
|
1675
|
+
if name:
|
1676
|
+
username = prompts.user_name.format(name=name)
|
1677
|
+
|
1678
|
+
automation_format_prompt = prompts.automation_format_prompt.format(
|
1679
|
+
original_query=scheduling_request,
|
1680
|
+
executed_query=executed_query,
|
1681
|
+
response=ai_response,
|
1682
|
+
username=username,
|
1683
|
+
)
|
1684
|
+
|
1685
|
+
with timer("Chat actor: Format automation response", logger):
|
1686
|
+
return send_message_to_model_wrapper_sync(automation_format_prompt, user=user)
|
1687
|
+
|
1688
|
+
|
1637
1689
|
def should_notify(original_query: str, executed_query: str, ai_response: str, user: KhojUser) -> bool:
|
1638
1690
|
"""
|
1639
1691
|
Decide whether to notify the user of the AI response.
|
@@ -1651,12 +1703,19 @@ def should_notify(original_query: str, executed_query: str, ai_response: str, us
|
|
1651
1703
|
with timer("Chat actor: Decide to notify user of automation response", logger):
|
1652
1704
|
try:
|
1653
1705
|
# TODO Replace with async call so we don't have to maintain a sync version
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1706
|
+
raw_response = send_message_to_model_wrapper_sync(to_notify_or_not, user=user, response_type="json_object")
|
1707
|
+
response = json.loads(raw_response)
|
1708
|
+
should_notify_result = response["decision"] == "Yes"
|
1709
|
+
reason = response.get("reason", "unknown")
|
1710
|
+
logger.info(
|
1711
|
+
f'Decided to {"not " if not should_notify_result else ""}notify user of automation response because of reason: {reason}.'
|
1712
|
+
)
|
1657
1713
|
return should_notify_result
|
1658
|
-
except:
|
1659
|
-
logger.warning(
|
1714
|
+
except Exception as e:
|
1715
|
+
logger.warning(
|
1716
|
+
f"Fallback to notify user of automation response as failed to infer should notify or not. {e}",
|
1717
|
+
exc_info=True,
|
1718
|
+
)
|
1660
1719
|
return True
|
1661
1720
|
|
1662
1721
|
|
@@ -1751,10 +1810,12 @@ def scheduled_chat(
|
|
1751
1810
|
if should_notify(
|
1752
1811
|
original_query=scheduling_request, executed_query=cleaned_query, ai_response=ai_response, user=user
|
1753
1812
|
):
|
1813
|
+
formatted_response = format_automation_response(scheduling_request, cleaned_query, ai_response, user)
|
1814
|
+
|
1754
1815
|
if is_resend_enabled():
|
1755
|
-
send_task_email(user.get_short_name(), user.email, cleaned_query,
|
1816
|
+
send_task_email(user.get_short_name(), user.email, cleaned_query, formatted_response, subject, is_image)
|
1756
1817
|
else:
|
1757
|
-
return
|
1818
|
+
return formatted_response
|
1758
1819
|
|
1759
1820
|
|
1760
1821
|
async def create_automation(
|
@@ -1766,12 +1827,66 @@ async def create_automation(
|
|
1766
1827
|
conversation_id: str = None,
|
1767
1828
|
tracer: dict = {},
|
1768
1829
|
):
|
1769
|
-
crontime, query_to_run, subject = await
|
1770
|
-
job = await
|
1830
|
+
crontime, query_to_run, subject = await aschedule_query(q, meta_log, user, tracer=tracer)
|
1831
|
+
job = await aschedule_automation(query_to_run, subject, crontime, timezone, q, user, calling_url, conversation_id)
|
1771
1832
|
return job, crontime, query_to_run, subject
|
1772
1833
|
|
1773
1834
|
|
1774
|
-
|
1835
|
+
def schedule_automation(
|
1836
|
+
query_to_run: str,
|
1837
|
+
subject: str,
|
1838
|
+
crontime: str,
|
1839
|
+
timezone: str,
|
1840
|
+
scheduling_request: str,
|
1841
|
+
user: KhojUser,
|
1842
|
+
calling_url: URL,
|
1843
|
+
conversation_id: str,
|
1844
|
+
):
|
1845
|
+
# Disable minute level automation recurrence
|
1846
|
+
minute_value = crontime.split(" ")[0]
|
1847
|
+
if not minute_value.isdigit():
|
1848
|
+
# Run automation at some random minute (to distribute request load) instead of running every X minutes
|
1849
|
+
crontime = " ".join([str(math.floor(random() * 60))] + crontime.split(" ")[1:])
|
1850
|
+
|
1851
|
+
user_timezone = pytz.timezone(timezone)
|
1852
|
+
trigger = CronTrigger.from_crontab(crontime, user_timezone)
|
1853
|
+
trigger.jitter = 60
|
1854
|
+
# Generate id and metadata used by task scheduler and process locks for the task runs
|
1855
|
+
job_metadata = json.dumps(
|
1856
|
+
{
|
1857
|
+
"query_to_run": query_to_run,
|
1858
|
+
"scheduling_request": scheduling_request,
|
1859
|
+
"subject": subject,
|
1860
|
+
"crontime": crontime,
|
1861
|
+
"conversation_id": str(conversation_id),
|
1862
|
+
}
|
1863
|
+
)
|
1864
|
+
query_id = hashlib.md5(f"{query_to_run}_{crontime}".encode("utf-8")).hexdigest()
|
1865
|
+
job_id = f"automation_{user.uuid}_{query_id}"
|
1866
|
+
job = state.scheduler.add_job(
|
1867
|
+
run_with_process_lock,
|
1868
|
+
trigger=trigger,
|
1869
|
+
args=(
|
1870
|
+
scheduled_chat,
|
1871
|
+
f"{ProcessLock.Operation.SCHEDULED_JOB}_{user.uuid}_{query_id}",
|
1872
|
+
),
|
1873
|
+
kwargs={
|
1874
|
+
"query_to_run": query_to_run,
|
1875
|
+
"scheduling_request": scheduling_request,
|
1876
|
+
"subject": subject,
|
1877
|
+
"user": user,
|
1878
|
+
"calling_url": calling_url,
|
1879
|
+
"job_id": job_id,
|
1880
|
+
"conversation_id": conversation_id,
|
1881
|
+
},
|
1882
|
+
id=job_id,
|
1883
|
+
name=job_metadata,
|
1884
|
+
max_instances=2, # Allow second instance to kill any previous instance with stale lock
|
1885
|
+
)
|
1886
|
+
return job
|
1887
|
+
|
1888
|
+
|
1889
|
+
async def aschedule_automation(
|
1775
1890
|
query_to_run: str,
|
1776
1891
|
subject: str,
|
1777
1892
|
crontime: str,
|