khoj 1.30.2.dev25__py3-none-any.whl → 1.30.2.dev32__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.
Files changed (58) hide show
  1. khoj/database/adapters/__init__.py +1 -1
  2. khoj/database/admin.py +39 -0
  3. khoj/interface/compiled/404/index.html +1 -1
  4. khoj/interface/compiled/_next/static/chunks/1603-ba5f9f05e92c8412.js +1 -0
  5. khoj/interface/compiled/_next/static/chunks/{6901-e3dc0d315e3f6033.js → 2646-92ba433951d02d52.js} +2 -2
  6. khoj/interface/compiled/_next/static/chunks/3463-081c031e873b7966.js +3 -0
  7. khoj/interface/compiled/_next/static/chunks/{6297-55f82537bb7068dd.js → 3717-b46079dbe9f55694.js} +1 -1
  8. khoj/interface/compiled/_next/static/chunks/4752-554a3db270186ce3.js +1 -0
  9. khoj/interface/compiled/_next/static/chunks/app/agents/{page-b086c9b0aa5a3833.js → page-8eead7920b0ff92a.js} +1 -1
  10. khoj/interface/compiled/_next/static/chunks/app/automations/{page-697a2d415e11a872.js → page-d5427acdd9297488.js} +1 -1
  11. khoj/interface/compiled/_next/static/chunks/app/chat/{page-461e26fcb7578d39.js → page-1ea11f1d3a28aa41.js} +1 -1
  12. khoj/interface/compiled/_next/static/chunks/app/{page-4a3c49c5e996cc40.js → page-f203261ce4fbff86.js} +1 -1
  13. khoj/interface/compiled/_next/static/chunks/app/search/{page-9013658bebfc3d17.js → page-faa998c71eb7ca8e.js} +1 -1
  14. khoj/interface/compiled/_next/static/chunks/app/settings/{page-41eb536497bb544a.js → page-cbe7f56b1f87d77a.js} +1 -1
  15. khoj/interface/compiled/_next/static/chunks/app/share/chat/{page-6a68ac7e227b34e7.js → page-cd5757199539bbf2.js} +1 -1
  16. khoj/interface/compiled/_next/static/css/2d097a35da6bfe8d.css +1 -0
  17. khoj/interface/compiled/_next/static/css/5d8d85d3f2e95bae.css +25 -0
  18. khoj/interface/compiled/agents/index.html +1 -1
  19. khoj/interface/compiled/agents/index.txt +2 -2
  20. khoj/interface/compiled/automations/index.html +1 -1
  21. khoj/interface/compiled/automations/index.txt +2 -2
  22. khoj/interface/compiled/chat/index.html +1 -1
  23. khoj/interface/compiled/chat/index.txt +2 -2
  24. khoj/interface/compiled/index.html +1 -1
  25. khoj/interface/compiled/index.txt +2 -2
  26. khoj/interface/compiled/search/index.html +1 -1
  27. khoj/interface/compiled/search/index.txt +2 -2
  28. khoj/interface/compiled/settings/index.html +1 -1
  29. khoj/interface/compiled/settings/index.txt +2 -2
  30. khoj/interface/compiled/share/chat/index.html +1 -1
  31. khoj/interface/compiled/share/chat/index.txt +2 -2
  32. khoj/processor/conversation/anthropic/anthropic_chat.py +8 -2
  33. khoj/processor/conversation/anthropic/utils.py +8 -3
  34. khoj/processor/conversation/google/gemini_chat.py +8 -2
  35. khoj/processor/conversation/google/utils.py +8 -3
  36. khoj/processor/conversation/offline/chat_model.py +12 -4
  37. khoj/processor/conversation/openai/gpt.py +9 -2
  38. khoj/processor/conversation/openai/utils.py +7 -3
  39. khoj/processor/conversation/utils.py +7 -4
  40. khoj/processor/tools/run_code.py +1 -25
  41. khoj/routers/api_chat.py +11 -1
  42. khoj/routers/api_subscription.py +9 -2
  43. khoj/routers/research.py +2 -1
  44. khoj/utils/helpers.py +31 -1
  45. {khoj-1.30.2.dev25.dist-info → khoj-1.30.2.dev32.dist-info}/METADATA +1 -1
  46. {khoj-1.30.2.dev25.dist-info → khoj-1.30.2.dev32.dist-info}/RECORD +51 -53
  47. khoj/interface/compiled/_next/static/chunks/1603-1407afe510f0145a.js +0 -1
  48. khoj/interface/compiled/_next/static/chunks/216-b2e4344315b88832.js +0 -1
  49. khoj/interface/compiled/_next/static/chunks/3124-e8410bbd01f6f188.js +0 -1
  50. khoj/interface/compiled/_next/static/chunks/796-36ee2d6829448c6d.js +0 -3
  51. khoj/interface/compiled/_next/static/chunks/9417-06236cd650f1abcd.js +0 -1
  52. khoj/interface/compiled/_next/static/css/1a4038cc4acc8ee4.css +0 -25
  53. khoj/interface/compiled/_next/static/css/23f801d22927d568.css +0 -1
  54. /khoj/interface/compiled/_next/static/{EhCSAofyXOB2cddYUBDFv → _61HZUDJ9HVJprBQTzLoD}/_buildManifest.js +0 -0
  55. /khoj/interface/compiled/_next/static/{EhCSAofyXOB2cddYUBDFv → _61HZUDJ9HVJprBQTzLoD}/_ssgManifest.js +0 -0
  56. {khoj-1.30.2.dev25.dist-info → khoj-1.30.2.dev32.dist-info}/WHEEL +0 -0
  57. {khoj-1.30.2.dev25.dist-info → khoj-1.30.2.dev32.dist-info}/entry_points.txt +0 -0
  58. {khoj-1.30.2.dev25.dist-info → khoj-1.30.2.dev32.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/5455839c73f146e7-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/0e9d53dcd7f11342.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/1a4038cc4acc8ee4.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/3cf13271869a4aeb.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/23f801d22927d568.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/1f293605f2871853.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-9b0a570f15d6209d.js"/><script src="/_next/static/chunks/fd9d1056-2e6c8140e79afc3b.js" async=""></script><script src="/_next/static/chunks/7023-e8de2bded4df6539.js" async=""></script><script src="/_next/static/chunks/main-app-6d6ee3495efe03d4.js" async=""></script><script src="/_next/static/chunks/d3ac728e-a9e3522eef9b6b28.js" async=""></script><script src="/_next/static/chunks/3072-be830e4f8412b9d2.js" async=""></script><script src="/_next/static/chunks/216-b2e4344315b88832.js" async=""></script><script src="/_next/static/chunks/3124-e8410bbd01f6f188.js" async=""></script><script src="/_next/static/chunks/7592-a09c39a38e60634b.js" async=""></script><script src="/_next/static/chunks/3690-51312931ba1eae30.js" async=""></script><script src="/_next/static/chunks/796-36ee2d6829448c6d.js" async=""></script><script src="/_next/static/chunks/1603-1407afe510f0145a.js" async=""></script><script src="/_next/static/chunks/9417-06236cd650f1abcd.js" async=""></script><script src="/_next/static/chunks/8423-1dda16bc56236523.js" async=""></script><script src="/_next/static/chunks/5538-e5f3c9f4d67a64b9.js" async=""></script><script src="/_next/static/chunks/app/share/chat/page-6a68ac7e227b34e7.js" async=""></script><meta http-equiv="Content-Security-Policy" content="default-src &#x27;self&#x27; https://assets.khoj.dev; media-src * blob:; script-src &#x27;self&#x27; https://assets.khoj.dev &#x27;unsafe-inline&#x27; &#x27;unsafe-eval&#x27;; connect-src &#x27;self&#x27; blob: https://ipapi.co/json ws://localhost:42110; style-src &#x27;self&#x27; https://assets.khoj.dev &#x27;unsafe-inline&#x27; https://fonts.googleapis.com; img-src &#x27;self&#x27; data: blob: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src &#x27;self&#x27; https://assets.khoj.dev https://fonts.gstatic.com; child-src &#x27;none&#x27;; object-src &#x27;none&#x27;;"/><meta http-equiv="Content-Security-Policy" content="default-src &#x27;self&#x27; https://assets.khoj.dev; script-src &#x27;self&#x27; https://assets.khoj.dev &#x27;unsafe-inline&#x27; &#x27;unsafe-eval&#x27;; connect-src &#x27;self&#x27; blob: https://ipapi.co/json ws://localhost:42110; style-src &#x27;self&#x27; https://assets.khoj.dev &#x27;unsafe-inline&#x27; https://fonts.googleapis.com; img-src &#x27;self&#x27; data: blob: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src &#x27;self&#x27; https://assets.khoj.dev https://fonts.gstatic.com; child-src &#x27;none&#x27;; object-src &#x27;none&#x27;;"/><title>Khoj AI - Chat</title><meta name="description" content="Use this page to view a chat with Khoj AI."/><link rel="manifest" href="/static/khoj.webmanifest" crossorigin="use-credentials"/><meta property="og:title" content="Khoj AI"/><meta property="og:description" content="Your Second Brain."/><meta property="og:url" content="https://app.khoj.dev/"/><meta property="og:site_name" content="Khoj AI"/><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:image" content="https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png"/><meta property="og:image:width" content="1200"/><meta property="og:image:height" content="630"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:title" content="Khoj AI"/><meta name="twitter:description" content="Your Second Brain."/><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"/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png"/><meta name="twitter:image:width" content="1200"/><meta name="twitter:image:height" content="630"/><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-78c92fac7aa8fdd8.js" noModule=""></script></head><body class="__className_af6c42"><html lang="en"><body class="__className_af6c42"><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-9b0a570f15d6209d.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/5455839c73f146e7-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/css/0e9d53dcd7f11342.css\",\"style\"]\n3:HL[\"/_next/static/css/1a4038cc4acc8ee4.css\",\"style\"]\n4:HL[\"/_next/static/css/3cf13271869a4aeb.css\",\"style\"]\n5:HL[\"/_next/static/css/23f801d22927d568.css\",\"style\"]\n6:HL[\"/_next/static/css/1f293605f2871853.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"7:I[95751,[],\"\"]\n9:I[66513,[],\"ClientPageRoot\"]\na:I[5506,[\"3954\",\"static/chunks/d3ac728e-a9e3522eef9b6b28.js\",\"3072\",\"static/chunks/3072-be830e4f8412b9d2.js\",\"216\",\"static/chunks/216-b2e4344315b88832.js\",\"3124\",\"static/chunks/3124-e8410bbd01f6f188.js\",\"7592\",\"static/chunks/7592-a09c39a38e60634b.js\",\"3690\",\"static/chunks/3690-51312931ba1eae30.js\",\"796\",\"static/chunks/796-36ee2d6829448c6d.js\",\"1603\",\"static/chunks/1603-1407afe510f0145a.js\",\"9417\",\"static/chunks/9417-06236cd650f1abcd.js\",\"8423\",\"static/chunks/8423-1dda16bc56236523.js\",\"5538\",\"static/chunks/5538-e5f3c9f4d67a64b9.js\",\"3111\",\"static/chunks/app/share/chat/page-6a68ac7e227b34e7.js\"],\"default\",1]\nb:I[39275,[],\"\"]\nc:I[61343,[],\"\"]\ne:I[76130,[],\"\"]\nf:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L7\",null,{\"buildId\":\"EhCSAofyXOB2cddYUBDFv\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"share\",\"chat\",\"\"],\"initialTree\":[\"\",{\"children\":[\"share\",{\"children\":[\"chat\",{\"children\":[\"__PAGE__\",{}]}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"share\",{\"children\":[\"chat\",{\"children\":[\"__PAGE__\",{},[[\"$L8\",[\"$\",\"$L9\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$a\"}],[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/3cf13271869a4aeb.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/23f801d22927d568.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/1f293605f2871853.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]]],null],null]},[[null,[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"meta\",null,{\"httpEquiv\":\"Content-Security-Policy\",\"content\":\"default-src 'self' https://assets.khoj.dev; script-src 'self' https://assets.khoj.dev 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: blob: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; child-src 'none'; object-src 'none';\"}],[\"$\",\"body\",null,{\"className\":\"__className_af6c42\",\"children\":[[\"$\",\"$Lb\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"share\",\"children\",\"chat\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lc\",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,[\"$\",\"$Lb\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"share\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lc\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/0e9d53dcd7f11342.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/1a4038cc4acc8ee4.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"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 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: blob: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; child-src 'none'; object-src 'none';\"}],[\"$\",\"body\",null,{\"className\":\"__className_af6c42\",\"children\":[\"$\",\"$Lb\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lc\",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,\"$Ld\"],\"globalErrorComponent\":\"$e\",\"missingSlots\":\"$Wf\"}]\n"])</script><script>self.__next_f.push([1,"d:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Khoj AI - Chat\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Use this page to view a chat with Khoj AI.\"}],[\"$\",\"link\",\"4\",{\"rel\":\"manifest\",\"href\":\"/static/khoj.webmanifest\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"5\",{\"property\":\"og:title\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"6\",{\"property\":\"og:description\",\"content\":\"Your Second Brain.\"}],[\"$\",\"meta\",\"7\",{\"property\":\"og:url\",\"content\":\"https://app.khoj.dev/\"}],[\"$\",\"meta\",\"8\",{\"property\":\"og:site_name\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"9\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"10\",{\"property\":\"og:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:image:width\",\"content\":\"1200\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:image:height\",\"content\":\"630\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"16\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:title\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:description\",\"content\":\"Your Second Brain.\"}],[\"$\",\"meta\",\"19\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"22\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png\"}],[\"$\",\"meta\",\"23\",{\"name\":\"twitter:image:width\",\"content\":\"1200\"}],[\"$\",\"meta\",\"24\",{\"name\":\"twitter:image:height\",\"content\":\"630\"}],[\"$\",\"link\",\"25\",{\"rel\":\"icon\",\"href\":\"/static/assets/icons/khoj_lantern.ico\"}],[\"$\",\"link\",\"26\",{\"rel\":\"apple-touch-icon\",\"href\":\"/static/assets/icons/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"27\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"8:null\n"])</script></body></html>
1
+ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/5455839c73f146e7-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/0e9d53dcd7f11342.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/5d8d85d3f2e95bae.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/3cf13271869a4aeb.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/2d097a35da6bfe8d.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/1f293605f2871853.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-9b0a570f15d6209d.js"/><script src="/_next/static/chunks/fd9d1056-2e6c8140e79afc3b.js" async=""></script><script src="/_next/static/chunks/7023-e8de2bded4df6539.js" async=""></script><script src="/_next/static/chunks/main-app-6d6ee3495efe03d4.js" async=""></script><script src="/_next/static/chunks/d3ac728e-a9e3522eef9b6b28.js" async=""></script><script src="/_next/static/chunks/3072-be830e4f8412b9d2.js" async=""></script><script src="/_next/static/chunks/4752-554a3db270186ce3.js" async=""></script><script src="/_next/static/chunks/7592-a09c39a38e60634b.js" async=""></script><script src="/_next/static/chunks/3690-51312931ba1eae30.js" async=""></script><script src="/_next/static/chunks/3463-081c031e873b7966.js" async=""></script><script src="/_next/static/chunks/1603-ba5f9f05e92c8412.js" async=""></script><script src="/_next/static/chunks/8423-1dda16bc56236523.js" async=""></script><script src="/_next/static/chunks/5538-e5f3c9f4d67a64b9.js" async=""></script><script src="/_next/static/chunks/app/share/chat/page-cd5757199539bbf2.js" async=""></script><meta http-equiv="Content-Security-Policy" content="default-src &#x27;self&#x27; https://assets.khoj.dev; media-src * blob:; script-src &#x27;self&#x27; https://assets.khoj.dev &#x27;unsafe-inline&#x27; &#x27;unsafe-eval&#x27;; connect-src &#x27;self&#x27; blob: https://ipapi.co/json ws://localhost:42110; style-src &#x27;self&#x27; https://assets.khoj.dev &#x27;unsafe-inline&#x27; https://fonts.googleapis.com; img-src &#x27;self&#x27; data: blob: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src &#x27;self&#x27; https://assets.khoj.dev https://fonts.gstatic.com; child-src &#x27;none&#x27;; object-src &#x27;none&#x27;;"/><meta http-equiv="Content-Security-Policy" content="default-src &#x27;self&#x27; https://assets.khoj.dev; script-src &#x27;self&#x27; https://assets.khoj.dev &#x27;unsafe-inline&#x27; &#x27;unsafe-eval&#x27;; connect-src &#x27;self&#x27; blob: https://ipapi.co/json ws://localhost:42110; style-src &#x27;self&#x27; https://assets.khoj.dev &#x27;unsafe-inline&#x27; https://fonts.googleapis.com; img-src &#x27;self&#x27; data: blob: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src &#x27;self&#x27; https://assets.khoj.dev https://fonts.gstatic.com; child-src &#x27;none&#x27;; object-src &#x27;none&#x27;;"/><title>Khoj AI - Chat</title><meta name="description" content="Use this page to view a chat with Khoj AI."/><link rel="manifest" href="/static/khoj.webmanifest" crossorigin="use-credentials"/><meta property="og:title" content="Khoj AI"/><meta property="og:description" content="Your Second Brain."/><meta property="og:url" content="https://app.khoj.dev/"/><meta property="og:site_name" content="Khoj AI"/><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:image" content="https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png"/><meta property="og:image:width" content="1200"/><meta property="og:image:height" content="630"/><meta property="og:type" content="website"/><meta name="twitter:card" content="summary_large_image"/><meta name="twitter:title" content="Khoj AI"/><meta name="twitter:description" content="Your Second Brain."/><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"/><meta name="twitter:image" content="https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png"/><meta name="twitter:image:width" content="1200"/><meta name="twitter:image:height" content="630"/><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-78c92fac7aa8fdd8.js" noModule=""></script></head><body class="__className_af6c42"><html lang="en"><body class="__className_af6c42"><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-9b0a570f15d6209d.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/5455839c73f146e7-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/css/0e9d53dcd7f11342.css\",\"style\"]\n3:HL[\"/_next/static/css/5d8d85d3f2e95bae.css\",\"style\"]\n4:HL[\"/_next/static/css/3cf13271869a4aeb.css\",\"style\"]\n5:HL[\"/_next/static/css/2d097a35da6bfe8d.css\",\"style\"]\n6:HL[\"/_next/static/css/1f293605f2871853.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"7:I[95751,[],\"\"]\n9:I[66513,[],\"ClientPageRoot\"]\na:I[5506,[\"3954\",\"static/chunks/d3ac728e-a9e3522eef9b6b28.js\",\"3072\",\"static/chunks/3072-be830e4f8412b9d2.js\",\"4752\",\"static/chunks/4752-554a3db270186ce3.js\",\"7592\",\"static/chunks/7592-a09c39a38e60634b.js\",\"3690\",\"static/chunks/3690-51312931ba1eae30.js\",\"3463\",\"static/chunks/3463-081c031e873b7966.js\",\"1603\",\"static/chunks/1603-ba5f9f05e92c8412.js\",\"8423\",\"static/chunks/8423-1dda16bc56236523.js\",\"5538\",\"static/chunks/5538-e5f3c9f4d67a64b9.js\",\"3111\",\"static/chunks/app/share/chat/page-cd5757199539bbf2.js\"],\"default\",1]\nb:I[39275,[],\"\"]\nc:I[61343,[],\"\"]\ne:I[76130,[],\"\"]\nf:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L7\",null,{\"buildId\":\"_61HZUDJ9HVJprBQTzLoD\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"share\",\"chat\",\"\"],\"initialTree\":[\"\",{\"children\":[\"share\",{\"children\":[\"chat\",{\"children\":[\"__PAGE__\",{}]}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"share\",{\"children\":[\"chat\",{\"children\":[\"__PAGE__\",{},[[\"$L8\",[\"$\",\"$L9\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$a\"}],[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/3cf13271869a4aeb.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/2d097a35da6bfe8d.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"2\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/1f293605f2871853.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]]],null],null]},[[null,[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"meta\",null,{\"httpEquiv\":\"Content-Security-Policy\",\"content\":\"default-src 'self' https://assets.khoj.dev; script-src 'self' https://assets.khoj.dev 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: blob: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; child-src 'none'; object-src 'none';\"}],[\"$\",\"body\",null,{\"className\":\"__className_af6c42\",\"children\":[[\"$\",\"$Lb\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"share\",\"children\",\"chat\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lc\",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,[\"$\",\"$Lb\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"share\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lc\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/0e9d53dcd7f11342.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/5d8d85d3f2e95bae.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"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 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: blob: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; child-src 'none'; object-src 'none';\"}],[\"$\",\"body\",null,{\"className\":\"__className_af6c42\",\"children\":[\"$\",\"$Lb\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lc\",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,\"$Ld\"],\"globalErrorComponent\":\"$e\",\"missingSlots\":\"$Wf\"}]\n"])</script><script>self.__next_f.push([1,"d:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Khoj AI - Chat\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Use this page to view a chat with Khoj AI.\"}],[\"$\",\"link\",\"4\",{\"rel\":\"manifest\",\"href\":\"/static/khoj.webmanifest\",\"crossOrigin\":\"use-credentials\"}],[\"$\",\"meta\",\"5\",{\"property\":\"og:title\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"6\",{\"property\":\"og:description\",\"content\":\"Your Second Brain.\"}],[\"$\",\"meta\",\"7\",{\"property\":\"og:url\",\"content\":\"https://app.khoj.dev/\"}],[\"$\",\"meta\",\"8\",{\"property\":\"og:site_name\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"9\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"10\",{\"property\":\"og:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"11\",{\"property\":\"og:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"12\",{\"property\":\"og:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png\"}],[\"$\",\"meta\",\"13\",{\"property\":\"og:image:width\",\"content\":\"1200\"}],[\"$\",\"meta\",\"14\",{\"property\":\"og:image:height\",\"content\":\"630\"}],[\"$\",\"meta\",\"15\",{\"property\":\"og:type\",\"content\":\"website\"}],[\"$\",\"meta\",\"16\",{\"name\":\"twitter:card\",\"content\":\"summary_large_image\"}],[\"$\",\"meta\",\"17\",{\"name\":\"twitter:title\",\"content\":\"Khoj AI\"}],[\"$\",\"meta\",\"18\",{\"name\":\"twitter:description\",\"content\":\"Your Second Brain.\"}],[\"$\",\"meta\",\"19\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"20\",{\"name\":\"twitter:image:width\",\"content\":\"256\"}],[\"$\",\"meta\",\"21\",{\"name\":\"twitter:image:height\",\"content\":\"256\"}],[\"$\",\"meta\",\"22\",{\"name\":\"twitter:image\",\"content\":\"https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png\"}],[\"$\",\"meta\",\"23\",{\"name\":\"twitter:image:width\",\"content\":\"1200\"}],[\"$\",\"meta\",\"24\",{\"name\":\"twitter:image:height\",\"content\":\"630\"}],[\"$\",\"link\",\"25\",{\"rel\":\"icon\",\"href\":\"/static/assets/icons/khoj_lantern.ico\"}],[\"$\",\"link\",\"26\",{\"rel\":\"apple-touch-icon\",\"href\":\"/static/assets/icons/khoj_lantern_256x256.png\"}],[\"$\",\"meta\",\"27\",{\"name\":\"next-size-adjust\"}]]\n"])</script><script>self.__next_f.push([1,"8:null\n"])</script></body></html>
@@ -1,7 +1,7 @@
1
1
  2:I[66513,[],"ClientPageRoot"]
2
- 3:I[5506,["3954","static/chunks/d3ac728e-a9e3522eef9b6b28.js","3072","static/chunks/3072-be830e4f8412b9d2.js","216","static/chunks/216-b2e4344315b88832.js","3124","static/chunks/3124-e8410bbd01f6f188.js","7592","static/chunks/7592-a09c39a38e60634b.js","3690","static/chunks/3690-51312931ba1eae30.js","796","static/chunks/796-36ee2d6829448c6d.js","1603","static/chunks/1603-1407afe510f0145a.js","9417","static/chunks/9417-06236cd650f1abcd.js","8423","static/chunks/8423-1dda16bc56236523.js","5538","static/chunks/5538-e5f3c9f4d67a64b9.js","3111","static/chunks/app/share/chat/page-6a68ac7e227b34e7.js"],"default",1]
2
+ 3:I[5506,["3954","static/chunks/d3ac728e-a9e3522eef9b6b28.js","3072","static/chunks/3072-be830e4f8412b9d2.js","4752","static/chunks/4752-554a3db270186ce3.js","7592","static/chunks/7592-a09c39a38e60634b.js","3690","static/chunks/3690-51312931ba1eae30.js","3463","static/chunks/3463-081c031e873b7966.js","1603","static/chunks/1603-ba5f9f05e92c8412.js","8423","static/chunks/8423-1dda16bc56236523.js","5538","static/chunks/5538-e5f3c9f4d67a64b9.js","3111","static/chunks/app/share/chat/page-cd5757199539bbf2.js"],"default",1]
3
3
  4:I[39275,[],""]
4
4
  5:I[61343,[],""]
5
- 0:["EhCSAofyXOB2cddYUBDFv",[[["",{"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/3cf13271869a4aeb.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/23f801d22927d568.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","2",{"rel":"stylesheet","href":"/_next/static/css/1f293605f2871853.css","precedence":"next","crossOrigin":"$undefined"}]]],null],null]},[[null,["$","html",null,{"lang":"en","children":[["$","meta",null,{"httpEquiv":"Content-Security-Policy","content":"default-src 'self' https://assets.khoj.dev; script-src 'self' https://assets.khoj.dev 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: blob: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; child-src 'none'; object-src 'none';"}],["$","body",null,{"className":"__className_af6c42","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/0e9d53dcd7f11342.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/1a4038cc4acc8ee4.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","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 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: blob: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; child-src 'none'; object-src 'none';"}],["$","body",null,{"className":"__className_af6c42","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]]]]
5
+ 0:["_61HZUDJ9HVJprBQTzLoD",[[["",{"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/3cf13271869a4aeb.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/2d097a35da6bfe8d.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","2",{"rel":"stylesheet","href":"/_next/static/css/1f293605f2871853.css","precedence":"next","crossOrigin":"$undefined"}]]],null],null]},[[null,["$","html",null,{"lang":"en","children":[["$","meta",null,{"httpEquiv":"Content-Security-Policy","content":"default-src 'self' https://assets.khoj.dev; script-src 'self' https://assets.khoj.dev 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: blob: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; child-src 'none'; object-src 'none';"}],["$","body",null,{"className":"__className_af6c42","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/0e9d53dcd7f11342.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/css/5d8d85d3f2e95bae.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","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 'unsafe-inline' 'unsafe-eval'; connect-src 'self' blob: https://ipapi.co/json ws://localhost:42110; style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: blob: https://*.khoj.dev https://*.googleusercontent.com https://*.google.com/ https://*.gstatic.com; font-src 'self' https://assets.khoj.dev https://fonts.gstatic.com; child-src 'none'; object-src 'none';"}],["$","body",null,{"className":"__className_af6c42","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 - Chat"}],["$","meta","3",{"name":"description","content":"Use this page to view a chat with Khoj AI."}],["$","link","4",{"rel":"manifest","href":"/static/khoj.webmanifest","crossOrigin":"use-credentials"}],["$","meta","5",{"property":"og:title","content":"Khoj AI"}],["$","meta","6",{"property":"og:description","content":"Your Second Brain."}],["$","meta","7",{"property":"og:url","content":"https://app.khoj.dev/"}],["$","meta","8",{"property":"og:site_name","content":"Khoj AI"}],["$","meta","9",{"property":"og:image","content":"https://assets.khoj.dev/khoj_lantern_256x256.png"}],["$","meta","10",{"property":"og:image:width","content":"256"}],["$","meta","11",{"property":"og:image:height","content":"256"}],["$","meta","12",{"property":"og:image","content":"https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png"}],["$","meta","13",{"property":"og:image:width","content":"1200"}],["$","meta","14",{"property":"og:image:height","content":"630"}],["$","meta","15",{"property":"og:type","content":"website"}],["$","meta","16",{"name":"twitter:card","content":"summary_large_image"}],["$","meta","17",{"name":"twitter:title","content":"Khoj AI"}],["$","meta","18",{"name":"twitter:description","content":"Your Second Brain."}],["$","meta","19",{"name":"twitter:image","content":"https://assets.khoj.dev/khoj_lantern_256x256.png"}],["$","meta","20",{"name":"twitter:image:width","content":"256"}],["$","meta","21",{"name":"twitter:image:height","content":"256"}],["$","meta","22",{"name":"twitter:image","content":"https://assets.khoj.dev/khoj_lantern_logomarktype_1200x630.png"}],["$","meta","23",{"name":"twitter:image:width","content":"1200"}],["$","meta","24",{"name":"twitter:image:height","content":"630"}],["$","link","25",{"rel":"icon","href":"/static/assets/icons/khoj_lantern.ico"}],["$","link","26",{"rel":"apple-touch-icon","href":"/static/assets/icons/khoj_lantern_256x256.png"}],["$","meta","27",{"name":"next-size-adjust"}]]
7
7
  1:null
@@ -19,7 +19,11 @@ from khoj.processor.conversation.utils import (
19
19
  generate_chatml_messages_with_context,
20
20
  messages_to_print,
21
21
  )
22
- from khoj.utils.helpers import ConversationCommand, is_none_or_empty
22
+ from khoj.utils.helpers import (
23
+ ConversationCommand,
24
+ is_none_or_empty,
25
+ truncate_code_context,
26
+ )
23
27
  from khoj.utils.rawconfig import LocationData
24
28
  from khoj.utils.yaml import yaml_dump
25
29
 
@@ -197,7 +201,9 @@ def converse_anthropic(
197
201
  if ConversationCommand.Online in conversation_commands or ConversationCommand.Webpage in conversation_commands:
198
202
  context_message += f"{prompts.online_search_conversation.format(online_results=yaml_dump(online_results))}\n\n"
199
203
  if ConversationCommand.Code in conversation_commands and not is_none_or_empty(code_results):
200
- context_message += f"{prompts.code_executed_context.format(code_results=str(code_results))}\n\n"
204
+ context_message += (
205
+ f"{prompts.code_executed_context.format(code_results=truncate_code_context(code_results))}\n\n"
206
+ )
201
207
  context_message = context_message.strip()
202
208
 
203
209
  # Setup Prompt with Primer or Conversation History
@@ -18,7 +18,12 @@ from khoj.processor.conversation.utils import (
18
18
  get_image_from_url,
19
19
  )
20
20
  from khoj.utils import state
21
- from khoj.utils.helpers import get_chat_usage_metrics, in_debug_mode, is_none_or_empty
21
+ from khoj.utils.helpers import (
22
+ get_chat_usage_metrics,
23
+ in_debug_mode,
24
+ is_none_or_empty,
25
+ is_promptrace_enabled,
26
+ )
22
27
 
23
28
  logger = logging.getLogger(__name__)
24
29
 
@@ -84,7 +89,7 @@ def anthropic_completion_with_backoff(
84
89
  # Save conversation trace
85
90
  tracer["chat_model"] = model_name
86
91
  tracer["temperature"] = temperature
87
- if in_debug_mode() or state.verbose > 1:
92
+ if is_promptrace_enabled():
88
93
  commit_conversation_trace(messages, aggregated_response, tracer)
89
94
 
90
95
  return aggregated_response
@@ -156,7 +161,7 @@ def anthropic_llm_thread(
156
161
  # Save conversation trace
157
162
  tracer["chat_model"] = model_name
158
163
  tracer["temperature"] = temperature
159
- if in_debug_mode() or state.verbose > 1:
164
+ if is_promptrace_enabled():
160
165
  commit_conversation_trace(messages, aggregated_response, tracer)
161
166
  except Exception as e:
162
167
  logger.error(f"Error in anthropic_llm_thread: {e}", exc_info=True)
@@ -19,7 +19,11 @@ from khoj.processor.conversation.utils import (
19
19
  generate_chatml_messages_with_context,
20
20
  messages_to_print,
21
21
  )
22
- from khoj.utils.helpers import ConversationCommand, is_none_or_empty
22
+ from khoj.utils.helpers import (
23
+ ConversationCommand,
24
+ is_none_or_empty,
25
+ truncate_code_context,
26
+ )
23
27
  from khoj.utils.rawconfig import LocationData
24
28
  from khoj.utils.yaml import yaml_dump
25
29
 
@@ -208,7 +212,9 @@ def converse_gemini(
208
212
  if ConversationCommand.Online in conversation_commands or ConversationCommand.Webpage in conversation_commands:
209
213
  context_message += f"{prompts.online_search_conversation.format(online_results=yaml_dump(online_results))}\n\n"
210
214
  if ConversationCommand.Code in conversation_commands and not is_none_or_empty(code_results):
211
- context_message += f"{prompts.code_executed_context.format(code_results=str(code_results))}\n\n"
215
+ context_message += (
216
+ f"{prompts.code_executed_context.format(code_results=truncate_code_context(code_results))}\n\n"
217
+ )
212
218
  context_message = context_message.strip()
213
219
 
214
220
  # Setup Prompt with Primer or Conversation History
@@ -25,7 +25,12 @@ from khoj.processor.conversation.utils import (
25
25
  get_image_from_url,
26
26
  )
27
27
  from khoj.utils import state
28
- from khoj.utils.helpers import get_chat_usage_metrics, in_debug_mode, is_none_or_empty
28
+ from khoj.utils.helpers import (
29
+ get_chat_usage_metrics,
30
+ in_debug_mode,
31
+ is_none_or_empty,
32
+ is_promptrace_enabled,
33
+ )
29
34
 
30
35
  logger = logging.getLogger(__name__)
31
36
 
@@ -84,7 +89,7 @@ def gemini_completion_with_backoff(
84
89
  # Save conversation trace
85
90
  tracer["chat_model"] = model_name
86
91
  tracer["temperature"] = temperature
87
- if in_debug_mode() or state.verbose > 1:
92
+ if is_promptrace_enabled():
88
93
  commit_conversation_trace(messages, response_text, tracer)
89
94
 
90
95
  return response_text
@@ -160,7 +165,7 @@ def gemini_llm_thread(
160
165
  # Save conversation trace
161
166
  tracer["chat_model"] = model_name
162
167
  tracer["temperature"] = temperature
163
- if in_debug_mode() or state.verbose > 1:
168
+ if is_promptrace_enabled():
164
169
  commit_conversation_trace(messages, aggregated_response, tracer)
165
170
  except StopCandidateException as e:
166
171
  logger.warning(
@@ -19,7 +19,13 @@ from khoj.processor.conversation.utils import (
19
19
  )
20
20
  from khoj.utils import state
21
21
  from khoj.utils.constants import empty_escape_sequences
22
- from khoj.utils.helpers import ConversationCommand, in_debug_mode, is_none_or_empty
22
+ from khoj.utils.helpers import (
23
+ ConversationCommand,
24
+ in_debug_mode,
25
+ is_none_or_empty,
26
+ is_promptrace_enabled,
27
+ truncate_code_context,
28
+ )
23
29
  from khoj.utils.rawconfig import LocationData
24
30
  from khoj.utils.yaml import yaml_dump
25
31
 
@@ -206,7 +212,9 @@ def converse_offline(
206
212
 
207
213
  context_message += f"{prompts.online_search_conversation_offline.format(online_results=yaml_dump(simplified_online_results))}\n\n"
208
214
  if ConversationCommand.Code in conversation_commands and not is_none_or_empty(code_results):
209
- context_message += f"{prompts.code_executed_context.format(code_results=str(code_results))}\n\n"
215
+ context_message += (
216
+ f"{prompts.code_executed_context.format(code_results=truncate_code_context(code_results))}\n\n"
217
+ )
210
218
  context_message = context_message.strip()
211
219
 
212
220
  # Setup Prompt with Primer or Conversation History
@@ -246,7 +254,7 @@ def llm_thread(g, messages: List[ChatMessage], model: Any, max_prompt_size: int
246
254
  g.send(response_delta)
247
255
 
248
256
  # Save conversation trace
249
- if in_debug_mode() or state.verbose > 1:
257
+ if is_promptrace_enabled():
250
258
  commit_conversation_trace(messages, aggregated_response, tracer)
251
259
 
252
260
  finally:
@@ -287,7 +295,7 @@ def send_message_to_model_offline(
287
295
  # Streamed responses need to be saved by the calling function
288
296
  tracer["chat_model"] = model
289
297
  tracer["temperature"] = temperature
290
- if in_debug_mode() or state.verbose > 1:
298
+ if is_promptrace_enabled():
291
299
  commit_conversation_trace(messages, response_text, tracer)
292
300
 
293
301
  return response_text
@@ -17,7 +17,11 @@ from khoj.processor.conversation.utils import (
17
17
  generate_chatml_messages_with_context,
18
18
  messages_to_print,
19
19
  )
20
- from khoj.utils.helpers import ConversationCommand, is_none_or_empty
20
+ from khoj.utils.helpers import (
21
+ ConversationCommand,
22
+ is_none_or_empty,
23
+ truncate_code_context,
24
+ )
21
25
  from khoj.utils.rawconfig import LocationData
22
26
  from khoj.utils.yaml import yaml_dump
23
27
 
@@ -196,7 +200,10 @@ def converse(
196
200
  if not is_none_or_empty(online_results):
197
201
  context_message += f"{prompts.online_search_conversation.format(online_results=yaml_dump(online_results))}\n\n"
198
202
  if not is_none_or_empty(code_results):
199
- context_message += f"{prompts.code_executed_context.format(code_results=str(code_results))}\n\n"
203
+ context_message += (
204
+ f"{prompts.code_executed_context.format(code_results=truncate_code_context(code_results))}\n\n"
205
+ )
206
+
200
207
  context_message = context_message.strip()
201
208
 
202
209
  # Setup Prompt with Primer or Conversation History
@@ -20,7 +20,11 @@ from khoj.processor.conversation.utils import (
20
20
  commit_conversation_trace,
21
21
  )
22
22
  from khoj.utils import state
23
- from khoj.utils.helpers import get_chat_usage_metrics, in_debug_mode
23
+ from khoj.utils.helpers import (
24
+ get_chat_usage_metrics,
25
+ in_debug_mode,
26
+ is_promptrace_enabled,
27
+ )
24
28
 
25
29
  logger = logging.getLogger(__name__)
26
30
 
@@ -97,7 +101,7 @@ def completion_with_backoff(
97
101
  # Save conversation trace
98
102
  tracer["chat_model"] = model
99
103
  tracer["temperature"] = temperature
100
- if in_debug_mode() or state.verbose > 1:
104
+ if is_promptrace_enabled():
101
105
  commit_conversation_trace(messages, aggregated_response, tracer)
102
106
 
103
107
  return aggregated_response
@@ -208,7 +212,7 @@ def llm_thread(
208
212
  # Save conversation trace
209
213
  tracer["chat_model"] = model_name
210
214
  tracer["temperature"] = temperature
211
- if in_debug_mode() or state.verbose > 1:
215
+ if is_promptrace_enabled():
212
216
  commit_conversation_trace(messages, aggregated_response, tracer)
213
217
  except Exception as e:
214
218
  logger.error(f"Error in llm_thread: {e}", exc_info=True)
@@ -34,6 +34,7 @@ from khoj.utils.helpers import (
34
34
  ConversationCommand,
35
35
  in_debug_mode,
36
36
  is_none_or_empty,
37
+ is_promptrace_enabled,
37
38
  merge_dicts,
38
39
  )
39
40
  from khoj.utils.rawconfig import FileAttachment
@@ -292,7 +293,7 @@ def save_to_conversation_log(
292
293
  user_message=q,
293
294
  )
294
295
 
295
- if os.getenv("PROMPTRACE_DIR"):
296
+ if is_promptrace_enabled():
296
297
  merge_message_into_conversation_trace(q, chat_response, tracer)
297
298
 
298
299
  logger.info(
@@ -591,7 +592,7 @@ def commit_conversation_trace(
591
592
  return None
592
593
 
593
594
  # Infer repository path from environment variable or provided path
594
- repo_path = repo_path or os.getenv("PROMPTRACE_DIR")
595
+ repo_path = repo_path if not is_none_or_empty(repo_path) else os.getenv("PROMPTRACE_DIR")
595
596
  if not repo_path:
596
597
  return None
597
598
 
@@ -686,7 +687,7 @@ Metadata
686
687
  return None
687
688
 
688
689
 
689
- def merge_message_into_conversation_trace(query: str, response: str, tracer: dict, repo_path="/tmp/promptrace") -> bool:
690
+ def merge_message_into_conversation_trace(query: str, response: str, tracer: dict, repo_path=None) -> bool:
690
691
  """
691
692
  Merge the message branch into its parent conversation branch.
692
693
 
@@ -709,7 +710,9 @@ def merge_message_into_conversation_trace(query: str, response: str, tracer: dic
709
710
  conv_branch = f"c_{tracer['cid']}"
710
711
 
711
712
  # Infer repository path from environment variable or provided path
712
- repo_path = os.getenv("PROMPTRACE_DIR", repo_path)
713
+ repo_path = repo_path if not is_none_or_empty(repo_path) else os.getenv("PROMPTRACE_DIR")
714
+ if not repo_path:
715
+ return None
713
716
  repo = Repo(repo_path)
714
717
 
715
718
  # Checkout conversation branch
@@ -1,5 +1,4 @@
1
1
  import base64
2
- import copy
3
2
  import datetime
4
3
  import json
5
4
  import logging
@@ -20,7 +19,7 @@ from khoj.processor.conversation.utils import (
20
19
  construct_chat_history,
21
20
  )
22
21
  from khoj.routers.helpers import send_message_to_model_wrapper
23
- from khoj.utils.helpers import is_none_or_empty, timer
22
+ from khoj.utils.helpers import is_none_or_empty, timer, truncate_code_context
24
23
  from khoj.utils.rawconfig import LocationData
25
24
 
26
25
  logger = logging.getLogger(__name__)
@@ -180,26 +179,3 @@ async def execute_sandboxed_python(code: str, input_data: list[dict], sandbox_ur
180
179
  "std_err": f"Failed to execute code with {response.status}",
181
180
  "output_files": [],
182
181
  }
183
-
184
-
185
- def truncate_code_context(original_code_results: dict[str, Any], max_chars=10000) -> dict[str, Any]:
186
- """
187
- Truncate large output files and drop image file data from code results.
188
- """
189
- # Create a deep copy of the code results to avoid modifying the original data
190
- code_results = copy.deepcopy(original_code_results)
191
- for code_result in code_results.values():
192
- for idx, output_file in enumerate(code_result["results"]["output_files"]):
193
- # Drop image files from code results
194
- if Path(output_file["filename"]).suffix in {".png", ".jpg", ".jpeg", ".webp"}:
195
- code_result["results"]["output_files"][idx] = {
196
- "filename": output_file["filename"],
197
- "b64_data": "[placeholder for generated image data for brevity]",
198
- }
199
- # Truncate large output files
200
- elif len(output_file["b64_data"]) > max_chars:
201
- code_result["results"]["output_files"][idx] = {
202
- "filename": output_file["filename"],
203
- "b64_data": output_file["b64_data"][:max_chars] + "...",
204
- }
205
- return code_results
khoj/routers/api_chat.py CHANGED
@@ -432,7 +432,15 @@ def chat_sessions(
432
432
  conversations = conversations[:8]
433
433
 
434
434
  sessions = conversations.values_list(
435
- "id", "slug", "title", "agent__slug", "agent__name", "created_at", "updated_at"
435
+ "id",
436
+ "slug",
437
+ "title",
438
+ "agent__slug",
439
+ "agent__name",
440
+ "created_at",
441
+ "updated_at",
442
+ "agent__style_icon",
443
+ "agent__style_color",
436
444
  )
437
445
 
438
446
  session_values = [
@@ -442,6 +450,8 @@ def chat_sessions(
442
450
  "agent_name": session[4],
443
451
  "created": session[5].strftime("%Y-%m-%d %H:%M:%S"),
444
452
  "updated": session[6].strftime("%Y-%m-%d %H:%M:%S"),
453
+ "agent_icon": session[7],
454
+ "agent_color": session[8],
445
455
  }
446
456
  for session in sessions
447
457
  ]
@@ -66,16 +66,23 @@ async def subscribe(request: Request):
66
66
  success = user is not None
67
67
  elif event_type in {"customer.subscription.updated"}:
68
68
  user_subscription = await sync_to_async(adapters.get_user_subscription)(customer_email)
69
+
70
+ renewal_date = None
71
+ if subscription["current_period_end"]:
72
+ renewal_date = datetime.fromtimestamp(subscription["current_period_end"], tz=timezone.utc)
73
+
69
74
  # Allow updating subscription status if paid user
70
75
  if user_subscription and user_subscription.renewal_date:
71
76
  # Mark user as unsubscribed or resubscribed
72
77
  is_recurring = not subscription["cancel_at_period_end"]
73
- user, is_new = await adapters.set_user_subscription(customer_email, is_recurring=is_recurring)
78
+ user, is_new = await adapters.set_user_subscription(
79
+ customer_email, is_recurring=is_recurring, renewal_date=renewal_date
80
+ )
74
81
  success = user is not None
75
82
  elif event_type in {"customer.subscription.deleted"}:
76
83
  # Reset the user to trial state
77
84
  user, is_new = await adapters.set_user_subscription(
78
- customer_email, is_recurring=False, renewal_date=False, type=Subscription.Type.TRIAL
85
+ customer_email, is_recurring=False, renewal_date=None, type=Subscription.Type.TRIAL
79
86
  )
80
87
  success = user is not None
81
88
 
khoj/routers/research.py CHANGED
@@ -16,7 +16,7 @@ from khoj.processor.conversation.utils import (
16
16
  construct_tool_chat_history,
17
17
  )
18
18
  from khoj.processor.tools.online_search import read_webpages, search_online
19
- from khoj.processor.tools.run_code import run_code, truncate_code_context
19
+ from khoj.processor.tools.run_code import run_code
20
20
  from khoj.routers.api import extract_references_and_questions
21
21
  from khoj.routers.helpers import (
22
22
  ChatEvent,
@@ -28,6 +28,7 @@ from khoj.utils.helpers import (
28
28
  function_calling_description_for_llm,
29
29
  is_none_or_empty,
30
30
  timer,
31
+ truncate_code_context,
31
32
  )
32
33
  from khoj.utils.rawconfig import LocationData
33
34
 
khoj/utils/helpers.py CHANGED
@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations # to avoid quoting type hints
2
2
 
3
+ import copy
3
4
  import datetime
4
5
  import io
5
6
  import ipaddress
@@ -18,7 +19,7 @@ from itertools import islice
18
19
  from os import path
19
20
  from pathlib import Path
20
21
  from time import perf_counter
21
- from typing import TYPE_CHECKING, Optional, Union
22
+ from typing import TYPE_CHECKING, Any, Optional, Union
22
23
  from urllib.parse import urlparse
23
24
 
24
25
  import psutil
@@ -451,6 +452,12 @@ def in_debug_mode():
451
452
  return is_env_var_true("KHOJ_DEBUG")
452
453
 
453
454
 
455
+ def is_promptrace_enabled():
456
+ """Check if Khoj is running with prompt tracing enabled.
457
+ Set PROMPTRACE_DIR environment variable to prompt tracing path to enable it."""
458
+ return not is_none_or_empty(os.getenv("PROMPTRACE_DIR"))
459
+
460
+
454
461
  def is_valid_url(url: str) -> bool:
455
462
  """Check if a string is a valid URL"""
456
463
  try:
@@ -521,6 +528,29 @@ def convert_image_to_webp(image_bytes):
521
528
  return webp_image_bytes
522
529
 
523
530
 
531
+ def truncate_code_context(original_code_results: dict[str, Any], max_chars=10000) -> dict[str, Any]:
532
+ """
533
+ Truncate large output files and drop image file data from code results.
534
+ """
535
+ # Create a deep copy of the code results to avoid modifying the original data
536
+ code_results = copy.deepcopy(original_code_results)
537
+ for code_result in code_results.values():
538
+ for idx, output_file in enumerate(code_result["results"]["output_files"]):
539
+ # Drop image files from code results
540
+ if Path(output_file["filename"]).suffix in {".png", ".jpg", ".jpeg", ".webp"}:
541
+ code_result["results"]["output_files"][idx] = {
542
+ "filename": output_file["filename"],
543
+ "b64_data": "[placeholder for generated image data for brevity]",
544
+ }
545
+ # Truncate large output files
546
+ elif len(output_file["b64_data"]) > max_chars:
547
+ code_result["results"]["output_files"][idx] = {
548
+ "filename": output_file["filename"],
549
+ "b64_data": output_file["b64_data"][:max_chars] + "...",
550
+ }
551
+ return code_results
552
+
553
+
524
554
  @lru_cache
525
555
  def tz_to_cc_map() -> dict[str, str]:
526
556
  """Create a mapping of timezone to country code"""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: khoj
3
- Version: 1.30.2.dev25
3
+ Version: 1.30.2.dev32
4
4
  Summary: Your Second Brain
5
5
  Project-URL: Homepage, https://khoj.dev
6
6
  Project-URL: Documentation, https://docs.khoj.dev