khoj 1.30.2__py3-none-any.whl → 1.30.2.dev15__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 (71) hide show
  1. khoj/database/adapters/__init__.py +1 -1
  2. khoj/database/admin.py +0 -39
  3. khoj/interface/compiled/404/index.html +1 -1
  4. khoj/interface/compiled/_next/static/chunks/1210.132a7e1910006bbb.js +1 -0
  5. khoj/interface/compiled/_next/static/chunks/1603-1407afe510f0145a.js +1 -0
  6. khoj/interface/compiled/_next/static/chunks/1970-e1935a1d0930a7c5.js +1 -0
  7. khoj/interface/compiled/_next/static/chunks/216-b2e4344315b88832.js +1 -0
  8. khoj/interface/compiled/_next/static/chunks/3124-e8410bbd01f6f188.js +1 -0
  9. khoj/interface/compiled/_next/static/chunks/{3717-b46079dbe9f55694.js → 6297-55f82537bb7068dd.js} +1 -1
  10. khoj/interface/compiled/_next/static/chunks/{2646-92ba433951d02d52.js → 6901-e3dc0d315e3f6033.js} +2 -2
  11. khoj/interface/compiled/_next/static/chunks/796-36ee2d6829448c6d.js +3 -0
  12. khoj/interface/compiled/_next/static/chunks/9417-06236cd650f1abcd.js +1 -0
  13. khoj/interface/compiled/_next/static/chunks/app/agents/{page-f5c0801b27a8e95e.js → page-b086c9b0aa5a3833.js} +1 -1
  14. khoj/interface/compiled/_next/static/chunks/app/automations/{page-0393501fad5f8e3d.js → page-697a2d415e11a872.js} +1 -1
  15. khoj/interface/compiled/_next/static/chunks/app/chat/{page-f2539e3197d03c0d.js → page-461e26fcb7578d39.js} +1 -1
  16. khoj/interface/compiled/_next/static/chunks/app/{page-5cc56a8db5d21b38.js → page-4a3c49c5e996cc40.js} +1 -1
  17. khoj/interface/compiled/_next/static/chunks/app/search/{page-e8b578d155550386.js → page-9013658bebfc3d17.js} +1 -1
  18. khoj/interface/compiled/_next/static/chunks/app/settings/{page-b6c835050c970be7.js → page-41eb536497bb544a.js} +1 -1
  19. khoj/interface/compiled/_next/static/chunks/app/share/chat/{page-635635e4fb39fe29.js → page-6a68ac7e227b34e7.js} +1 -1
  20. khoj/interface/compiled/_next/static/chunks/{webpack-5dbccc5145b80b64.js → webpack-224b38bd040ae7a0.js} +1 -1
  21. khoj/interface/compiled/_next/static/css/1a4038cc4acc8ee4.css +25 -0
  22. khoj/interface/compiled/_next/static/css/23f801d22927d568.css +1 -0
  23. khoj/interface/compiled/_next/static/css/80bd6301fc657983.css +1 -0
  24. khoj/interface/compiled/agents/index.html +1 -1
  25. khoj/interface/compiled/agents/index.txt +2 -2
  26. khoj/interface/compiled/automations/index.html +1 -1
  27. khoj/interface/compiled/automations/index.txt +2 -2
  28. khoj/interface/compiled/chat/index.html +1 -1
  29. khoj/interface/compiled/chat/index.txt +2 -2
  30. khoj/interface/compiled/index.html +1 -1
  31. khoj/interface/compiled/index.txt +2 -2
  32. khoj/interface/compiled/search/index.html +1 -1
  33. khoj/interface/compiled/search/index.txt +2 -2
  34. khoj/interface/compiled/settings/index.html +1 -1
  35. khoj/interface/compiled/settings/index.txt +2 -2
  36. khoj/interface/compiled/share/chat/index.html +1 -1
  37. khoj/interface/compiled/share/chat/index.txt +2 -2
  38. khoj/main.py +0 -4
  39. khoj/processor/conversation/anthropic/anthropic_chat.py +2 -8
  40. khoj/processor/conversation/anthropic/utils.py +3 -8
  41. khoj/processor/conversation/google/gemini_chat.py +2 -8
  42. khoj/processor/conversation/google/utils.py +3 -8
  43. khoj/processor/conversation/offline/chat_model.py +4 -12
  44. khoj/processor/conversation/openai/gpt.py +2 -9
  45. khoj/processor/conversation/openai/utils.py +3 -7
  46. khoj/processor/conversation/prompts.py +21 -40
  47. khoj/processor/conversation/utils.py +4 -7
  48. khoj/processor/tools/run_code.py +25 -1
  49. khoj/routers/api_chat.py +1 -11
  50. khoj/routers/api_subscription.py +2 -9
  51. khoj/routers/auth.py +2 -2
  52. khoj/routers/helpers.py +3 -15
  53. khoj/routers/research.py +1 -2
  54. khoj/utils/cli.py +0 -2
  55. khoj/utils/helpers.py +1 -31
  56. khoj/utils/state.py +0 -1
  57. {khoj-1.30.2.dist-info → khoj-1.30.2.dev15.dist-info}/METADATA +4 -9
  58. {khoj-1.30.2.dist-info → khoj-1.30.2.dev15.dist-info}/RECORD +63 -61
  59. khoj/interface/compiled/_next/static/chunks/1210.ef7a0f9a7e43da1d.js +0 -1
  60. khoj/interface/compiled/_next/static/chunks/1603-ba5f9f05e92c8412.js +0 -1
  61. khoj/interface/compiled/_next/static/chunks/1970-1b63ac1497b03a10.js +0 -1
  62. khoj/interface/compiled/_next/static/chunks/3463-081c031e873b7966.js +0 -3
  63. khoj/interface/compiled/_next/static/chunks/4752-554a3db270186ce3.js +0 -1
  64. khoj/interface/compiled/_next/static/css/4cae6c0e5c72fb2d.css +0 -1
  65. khoj/interface/compiled/_next/static/css/5d8d85d3f2e95bae.css +0 -25
  66. khoj/interface/compiled/_next/static/css/63e106a52a0ec4ca.css +0 -1
  67. /khoj/interface/compiled/_next/static/{UR4enQiSbkZKb3SDFX2tx → j4py4V8sxXHwFlBE4LvN_}/_buildManifest.js +0 -0
  68. /khoj/interface/compiled/_next/static/{UR4enQiSbkZKb3SDFX2tx → j4py4V8sxXHwFlBE4LvN_}/_ssgManifest.js +0 -0
  69. {khoj-1.30.2.dist-info → khoj-1.30.2.dev15.dist-info}/WHEEL +0 -0
  70. {khoj-1.30.2.dist-info → khoj-1.30.2.dev15.dist-info}/entry_points.txt +0 -0
  71. {khoj-1.30.2.dist-info → khoj-1.30.2.dev15.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/5d8d85d3f2e95bae.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/3cf13271869a4aeb.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/63e106a52a0ec4ca.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-5dbccc5145b80b64.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-635635e4fb39fe29.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-5dbccc5145b80b64.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/63e106a52a0ec4ca.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-635635e4fb39fe29.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\":\"UR4enQiSbkZKb3SDFX2tx\",\"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/63e106a52a0ec4ca.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
+ <!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-224b38bd040ae7a0.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-224b38bd040ae7a0.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\":\"j4py4V8sxXHwFlBE4LvN_\",\"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,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","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-635635e4fb39fe29.js"],"default",1]
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]
3
3
  4:I[39275,[],""]
4
4
  5:I[61343,[],""]
5
- 0:["UR4enQiSbkZKb3SDFX2tx",[[["",{"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/63e106a52a0ec4ca.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]]]]
5
+ 0:["j4py4V8sxXHwFlBE4LvN_",[[["",{"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]]]]
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
khoj/main.py CHANGED
@@ -208,9 +208,6 @@ def set_state(args):
208
208
  state.verbose = args.verbose
209
209
  state.host = args.host
210
210
  state.port = args.port
211
- state.ssl_config = (
212
- {"ssl_certfile": args.sslcert, "ssl_keyfile": args.sslkey} if args.sslcert and args.sslkey else None
213
- )
214
211
  state.anonymous_mode = args.anonymous_mode
215
212
  state.khoj_version = version("khoj")
216
213
  state.chat_on_gpu = args.chat_on_gpu
@@ -229,7 +226,6 @@ def start_server(app, host=None, port=None, socket=None):
229
226
  use_colors=True,
230
227
  log_config=None,
231
228
  timeout_keep_alive=60,
232
- **state.ssl_config if state.ssl_config else {},
233
229
  )
234
230
  logger.info("🌒 Stopping Khoj")
235
231
 
@@ -19,11 +19,7 @@ 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 (
23
- ConversationCommand,
24
- is_none_or_empty,
25
- truncate_code_context,
26
- )
22
+ from khoj.utils.helpers import ConversationCommand, is_none_or_empty
27
23
  from khoj.utils.rawconfig import LocationData
28
24
  from khoj.utils.yaml import yaml_dump
29
25
 
@@ -201,9 +197,7 @@ def converse_anthropic(
201
197
  if ConversationCommand.Online in conversation_commands or ConversationCommand.Webpage in conversation_commands:
202
198
  context_message += f"{prompts.online_search_conversation.format(online_results=yaml_dump(online_results))}\n\n"
203
199
  if ConversationCommand.Code in conversation_commands and not is_none_or_empty(code_results):
204
- context_message += (
205
- f"{prompts.code_executed_context.format(code_results=truncate_code_context(code_results))}\n\n"
206
- )
200
+ context_message += f"{prompts.code_executed_context.format(code_results=str(code_results))}\n\n"
207
201
  context_message = context_message.strip()
208
202
 
209
203
  # Setup Prompt with Primer or Conversation History
@@ -18,12 +18,7 @@ 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 (
22
- get_chat_usage_metrics,
23
- in_debug_mode,
24
- is_none_or_empty,
25
- is_promptrace_enabled,
26
- )
21
+ from khoj.utils.helpers import get_chat_usage_metrics, in_debug_mode, is_none_or_empty
27
22
 
28
23
  logger = logging.getLogger(__name__)
29
24
 
@@ -89,7 +84,7 @@ def anthropic_completion_with_backoff(
89
84
  # Save conversation trace
90
85
  tracer["chat_model"] = model_name
91
86
  tracer["temperature"] = temperature
92
- if is_promptrace_enabled():
87
+ if in_debug_mode() or state.verbose > 1:
93
88
  commit_conversation_trace(messages, aggregated_response, tracer)
94
89
 
95
90
  return aggregated_response
@@ -161,7 +156,7 @@ def anthropic_llm_thread(
161
156
  # Save conversation trace
162
157
  tracer["chat_model"] = model_name
163
158
  tracer["temperature"] = temperature
164
- if is_promptrace_enabled():
159
+ if in_debug_mode() or state.verbose > 1:
165
160
  commit_conversation_trace(messages, aggregated_response, tracer)
166
161
  except Exception as e:
167
162
  logger.error(f"Error in anthropic_llm_thread: {e}", exc_info=True)
@@ -19,11 +19,7 @@ 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 (
23
- ConversationCommand,
24
- is_none_or_empty,
25
- truncate_code_context,
26
- )
22
+ from khoj.utils.helpers import ConversationCommand, is_none_or_empty
27
23
  from khoj.utils.rawconfig import LocationData
28
24
  from khoj.utils.yaml import yaml_dump
29
25
 
@@ -212,9 +208,7 @@ def converse_gemini(
212
208
  if ConversationCommand.Online in conversation_commands or ConversationCommand.Webpage in conversation_commands:
213
209
  context_message += f"{prompts.online_search_conversation.format(online_results=yaml_dump(online_results))}\n\n"
214
210
  if ConversationCommand.Code in conversation_commands and not is_none_or_empty(code_results):
215
- context_message += (
216
- f"{prompts.code_executed_context.format(code_results=truncate_code_context(code_results))}\n\n"
217
- )
211
+ context_message += f"{prompts.code_executed_context.format(code_results=str(code_results))}\n\n"
218
212
  context_message = context_message.strip()
219
213
 
220
214
  # Setup Prompt with Primer or Conversation History
@@ -25,12 +25,7 @@ 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 (
29
- get_chat_usage_metrics,
30
- in_debug_mode,
31
- is_none_or_empty,
32
- is_promptrace_enabled,
33
- )
28
+ from khoj.utils.helpers import get_chat_usage_metrics, in_debug_mode, is_none_or_empty
34
29
 
35
30
  logger = logging.getLogger(__name__)
36
31
 
@@ -89,7 +84,7 @@ def gemini_completion_with_backoff(
89
84
  # Save conversation trace
90
85
  tracer["chat_model"] = model_name
91
86
  tracer["temperature"] = temperature
92
- if is_promptrace_enabled():
87
+ if in_debug_mode() or state.verbose > 1:
93
88
  commit_conversation_trace(messages, response_text, tracer)
94
89
 
95
90
  return response_text
@@ -165,7 +160,7 @@ def gemini_llm_thread(
165
160
  # Save conversation trace
166
161
  tracer["chat_model"] = model_name
167
162
  tracer["temperature"] = temperature
168
- if is_promptrace_enabled():
163
+ if in_debug_mode() or state.verbose > 1:
169
164
  commit_conversation_trace(messages, aggregated_response, tracer)
170
165
  except StopCandidateException as e:
171
166
  logger.warning(
@@ -19,13 +19,7 @@ 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 (
23
- ConversationCommand,
24
- in_debug_mode,
25
- is_none_or_empty,
26
- is_promptrace_enabled,
27
- truncate_code_context,
28
- )
22
+ from khoj.utils.helpers import ConversationCommand, in_debug_mode, is_none_or_empty
29
23
  from khoj.utils.rawconfig import LocationData
30
24
  from khoj.utils.yaml import yaml_dump
31
25
 
@@ -212,9 +206,7 @@ def converse_offline(
212
206
 
213
207
  context_message += f"{prompts.online_search_conversation_offline.format(online_results=yaml_dump(simplified_online_results))}\n\n"
214
208
  if ConversationCommand.Code in conversation_commands and not is_none_or_empty(code_results):
215
- context_message += (
216
- f"{prompts.code_executed_context.format(code_results=truncate_code_context(code_results))}\n\n"
217
- )
209
+ context_message += f"{prompts.code_executed_context.format(code_results=str(code_results))}\n\n"
218
210
  context_message = context_message.strip()
219
211
 
220
212
  # Setup Prompt with Primer or Conversation History
@@ -254,7 +246,7 @@ def llm_thread(g, messages: List[ChatMessage], model: Any, max_prompt_size: int
254
246
  g.send(response_delta)
255
247
 
256
248
  # Save conversation trace
257
- if is_promptrace_enabled():
249
+ if in_debug_mode() or state.verbose > 1:
258
250
  commit_conversation_trace(messages, aggregated_response, tracer)
259
251
 
260
252
  finally:
@@ -295,7 +287,7 @@ def send_message_to_model_offline(
295
287
  # Streamed responses need to be saved by the calling function
296
288
  tracer["chat_model"] = model
297
289
  tracer["temperature"] = temperature
298
- if is_promptrace_enabled():
290
+ if in_debug_mode() or state.verbose > 1:
299
291
  commit_conversation_trace(messages, response_text, tracer)
300
292
 
301
293
  return response_text
@@ -17,11 +17,7 @@ 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 (
21
- ConversationCommand,
22
- is_none_or_empty,
23
- truncate_code_context,
24
- )
20
+ from khoj.utils.helpers import ConversationCommand, is_none_or_empty
25
21
  from khoj.utils.rawconfig import LocationData
26
22
  from khoj.utils.yaml import yaml_dump
27
23
 
@@ -200,10 +196,7 @@ def converse(
200
196
  if not is_none_or_empty(online_results):
201
197
  context_message += f"{prompts.online_search_conversation.format(online_results=yaml_dump(online_results))}\n\n"
202
198
  if not is_none_or_empty(code_results):
203
- context_message += (
204
- f"{prompts.code_executed_context.format(code_results=truncate_code_context(code_results))}\n\n"
205
- )
206
-
199
+ context_message += f"{prompts.code_executed_context.format(code_results=str(code_results))}\n\n"
207
200
  context_message = context_message.strip()
208
201
 
209
202
  # Setup Prompt with Primer or Conversation History
@@ -20,11 +20,7 @@ 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 (
24
- get_chat_usage_metrics,
25
- in_debug_mode,
26
- is_promptrace_enabled,
27
- )
23
+ from khoj.utils.helpers import get_chat_usage_metrics, in_debug_mode
28
24
 
29
25
  logger = logging.getLogger(__name__)
30
26
 
@@ -101,7 +97,7 @@ def completion_with_backoff(
101
97
  # Save conversation trace
102
98
  tracer["chat_model"] = model
103
99
  tracer["temperature"] = temperature
104
- if is_promptrace_enabled():
100
+ if in_debug_mode() or state.verbose > 1:
105
101
  commit_conversation_trace(messages, aggregated_response, tracer)
106
102
 
107
103
  return aggregated_response
@@ -212,7 +208,7 @@ def llm_thread(
212
208
  # Save conversation trace
213
209
  tracer["chat_model"] = model_name
214
210
  tracer["temperature"] = temperature
215
- if is_promptrace_enabled():
211
+ if in_debug_mode() or state.verbose > 1:
216
212
  commit_conversation_trace(messages, aggregated_response, tracer)
217
213
  except Exception as e:
218
214
  logger.error(f"Error in llm_thread: {e}", exc_info=True)
@@ -183,23 +183,20 @@ Improved Prompt:
183
183
 
184
184
  improve_diagram_description_prompt = PromptTemplate.from_template(
185
185
  """
186
- you are an architect working with a novice digital artist using a diagramming software.
186
+ you are an architect working with a novice artist using a diagramming tool.
187
187
  {personality_context}
188
188
 
189
189
  you need to convert the user's query to a description format that the novice artist can use very well. you are allowed to use primitives like
190
190
  - text
191
191
  - rectangle
192
+ - diamond
192
193
  - ellipse
193
194
  - line
194
195
  - arrow
195
196
 
196
197
  use these primitives to describe what sort of diagram the drawer should create. the artist must recreate the diagram every time, so include all relevant prior information in your description.
197
198
 
198
- - include the full, exact description. the artist does not have much experience, so be precise.
199
- - describe the layout.
200
- - you can only use straight lines.
201
- - use simple, concise language.
202
- - keep it simple and easy to understand. the artist is easily distracted.
199
+ use simple, concise language.
203
200
 
204
201
  Today's Date: {current_date}
205
202
  User's Location: {location}
@@ -221,23 +218,19 @@ Query: {query}
221
218
 
222
219
  excalidraw_diagram_generation_prompt = PromptTemplate.from_template(
223
220
  """
224
- You are a program manager with the ability to describe diagrams to compose in professional, fine detail. You LOVE getting into the details and making tedious labels, lines, and shapes look beautiful. You make everything look perfect.
221
+ You are a program manager with the ability to describe diagrams to compose in professional, fine detail.
225
222
  {personality_context}
226
223
 
227
- You need to create a declarative description of the diagram and relevant components, using this base schema.
228
- - `label`: specify the text to be rendered in the respective elements.
229
- - Always use light colors for the `backgroundColor` property, like white, or light blue, green, red
230
- - **ALWAYS Required properties for ALL elements**: `type`, `x`, `y`, `id`.
231
- - Be very generous with spacing and composition. Use ample space between elements.
224
+ You need to create a declarative description of the diagram and relevant components, using this base schema. Use the `label` property to specify the text to be rendered in the respective elements. Always use light colors for the `backgroundColor` property, like white, or light blue, green, red. "type", "x", "y", "id", are required properties for all elements.
232
225
 
233
226
  {{
234
227
  type: string,
235
228
  x: number,
236
229
  y: number,
237
- width: number,
238
- height: number,
239
230
  strokeColor: string,
240
231
  backgroundColor: string,
232
+ width: number,
233
+ height: number,
241
234
  id: string,
242
235
  label: {{
243
236
  text: string,
@@ -247,30 +240,28 @@ You need to create a declarative description of the diagram and relevant compone
247
240
  Valid types:
248
241
  - text
249
242
  - rectangle
243
+ - diamond
250
244
  - ellipse
251
245
  - line
252
246
  - arrow
253
247
 
254
- For arrows and lines,
255
- - `points`: specify the start and end points of the arrow
256
- - **ALWAYS Required properties for ALL elements**: `type`, `x`, `y`, `id`.
257
- - `start` and `end` properties: connect the linear elements to other elements. The start and end point can either be the ID to map to an existing object, or the `type` and `text` to create a new object. Mapping to an existing object is useful if you want to connect it to multiple objects. Lines and arrows can only start and end at rectangle, text, or ellipse elements. Even if you're using the `start` and `end` properties, you still need to specify the `x` and `y` properties for the start and end points.
248
+ For arrows and lines, you can use the `points` property to specify the start and end points of the arrow. You may also use the `label` property to specify the text to be rendered. You may use the `start` and `end` properties to connect the linear elements to other elements. The start and end point can either be the ID to map to an existing object, or the `type` to create a new object. Mapping to an existing object is useful if you want to connect it to multiple objects. Lines and arrows can only start and end at rectangle, text, diamond, or ellipse elements.
258
249
 
259
250
  {{
260
251
  type: "arrow",
261
252
  id: string,
262
253
  x: number,
263
254
  y: number,
255
+ width: number,
256
+ height: number,
264
257
  strokeColor: string,
265
258
  start: {{
266
259
  id: string,
267
260
  type: string,
268
- text: string,
269
261
  }},
270
262
  end: {{
271
263
  id: string,
272
264
  type: string,
273
- text: string,
274
265
  }},
275
266
  label: {{
276
267
  text: string,
@@ -281,11 +272,7 @@ For arrows and lines,
281
272
  ]
282
273
  }}
283
274
 
284
- For text,
285
- - `text`: specify the text to be rendered
286
- - **ALWAYS Required properties for ALL elements**: `type`, `x`, `y`, `id`.
287
- - `fontSize`: optional property to specify the font size of the text
288
- - Use this element only for titles, subtitles, and overviews. For labels, use the `label` property in the respective elements.
275
+ For text, you must use the `text` property to specify the text to be rendered. You may also use `fontSize` property to specify the font size of the text. Only use the `text` element for titles, subtitles, and overviews. For labels, use the `label` property in the respective elements.
289
276
 
290
277
  {{
291
278
  type: "text",
@@ -300,25 +287,19 @@ Here's an example of a valid diagram:
300
287
 
301
288
  Design Description: Create a diagram describing a circular development process with 3 stages: design, implementation and feedback. The design stage is connected to the implementation stage and the implementation stage is connected to the feedback stage and the feedback stage is connected to the design stage. Each stage should be labeled with the stage name.
302
289
 
303
- Example Response:
304
- ```json
305
- {{
306
- "scratchpad": "The diagram represents a circular development process with 3 stages: design, implementation and feedback. Each stage is connected to the next stage using an arrow, forming a circular process.",
307
- "elements": [
308
- {{"type":"text","x":-150,"y":50,"id":"title_text","text":"Circular Development Process","fontSize":24}},
309
- {{"type":"ellipse","x":-169,"y":113,"id":"design_ellipse", "label": {{"text": "Design"}}}},
310
- {{"type":"ellipse","x":62,"y":394,"id":"implement_ellipse", "label": {{"text": "Implement"}}}},
311
- {{"type":"ellipse","x":-348,"y":430,"id":"feedback_ellipse", "label": {{"text": "Feedback"}}}},
290
+ Response:
291
+
292
+ [
293
+ {{"type":"text","x":-150,"y":50,"width":300,"height":40,"id":"title_text","text":"Circular Development Process","fontSize":24}},
294
+ {{"type":"ellipse","x":-169,"y":113,"width":188,"height":202,"id":"design_ellipse", "label": {{"text": "Design"}}}},
295
+ {{"type":"ellipse","x":62,"y":394,"width":186,"height":188,"id":"implement_ellipse", "label": {{"text": "Implement"}}}},
296
+ {{"type":"ellipse","x":-348,"y":430,"width":184,"height":170,"id":"feedback_ellipse", "label": {{"text": "Feedback"}}}},
312
297
  {{"type":"arrow","x":21,"y":273,"id":"design_to_implement_arrow","points":[[0,0],[86,105]],"start":{{"id":"design_ellipse"}}, "end":{{"id":"implement_ellipse"}}}},
313
298
  {{"type":"arrow","x":50,"y":519,"id":"implement_to_feedback_arrow","points":[[0,0],[-198,-6]],"start":{{"id":"implement_ellipse"}}, "end":{{"id":"feedback_ellipse"}}}},
314
299
  {{"type":"arrow","x":-228,"y":417,"id":"feedback_to_design_arrow","points":[[0,0],[85,-123]],"start":{{"id":"feedback_ellipse"}}, "end":{{"id":"design_ellipse"}}}},
315
- ]
316
- }}
317
- ```
318
-
319
- Think about spacing and composition. Use ample space between elements. Double the amount of space you think you need. Create a detailed diagram from the provided context and user prompt below.
300
+ ]
320
301
 
321
- Return a valid JSON object, where the drawing is in `elements` and your thought process is in `scratchpad`. If you can't make the whole diagram in one response, you can split it into multiple responses. If you need to simplify for brevity, simply do so in the `scratchpad` field. DO NOT add additional info in the `elements` field.
302
+ Create a detailed diagram from the provided context and user prompt below. Return a valid JSON object:
322
303
 
323
304
  Diagram Description: {query}
324
305
 
@@ -34,7 +34,6 @@ from khoj.utils.helpers import (
34
34
  ConversationCommand,
35
35
  in_debug_mode,
36
36
  is_none_or_empty,
37
- is_promptrace_enabled,
38
37
  merge_dicts,
39
38
  )
40
39
  from khoj.utils.rawconfig import FileAttachment
@@ -293,7 +292,7 @@ def save_to_conversation_log(
293
292
  user_message=q,
294
293
  )
295
294
 
296
- if is_promptrace_enabled():
295
+ if os.getenv("PROMPTRACE_DIR"):
297
296
  merge_message_into_conversation_trace(q, chat_response, tracer)
298
297
 
299
298
  logger.info(
@@ -592,7 +591,7 @@ def commit_conversation_trace(
592
591
  return None
593
592
 
594
593
  # Infer repository path from environment variable or provided path
595
- repo_path = repo_path if not is_none_or_empty(repo_path) else os.getenv("PROMPTRACE_DIR")
594
+ repo_path = repo_path or os.getenv("PROMPTRACE_DIR")
596
595
  if not repo_path:
597
596
  return None
598
597
 
@@ -687,7 +686,7 @@ Metadata
687
686
  return None
688
687
 
689
688
 
690
- def merge_message_into_conversation_trace(query: str, response: str, tracer: dict, repo_path=None) -> bool:
689
+ def merge_message_into_conversation_trace(query: str, response: str, tracer: dict, repo_path="/tmp/promptrace") -> bool:
691
690
  """
692
691
  Merge the message branch into its parent conversation branch.
693
692
 
@@ -710,9 +709,7 @@ def merge_message_into_conversation_trace(query: str, response: str, tracer: dic
710
709
  conv_branch = f"c_{tracer['cid']}"
711
710
 
712
711
  # Infer repository path from environment variable or provided 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
712
+ repo_path = os.getenv("PROMPTRACE_DIR", repo_path)
716
713
  repo = Repo(repo_path)
717
714
 
718
715
  # Checkout conversation branch
@@ -1,4 +1,5 @@
1
1
  import base64
2
+ import copy
2
3
  import datetime
3
4
  import json
4
5
  import logging
@@ -19,7 +20,7 @@ from khoj.processor.conversation.utils import (
19
20
  construct_chat_history,
20
21
  )
21
22
  from khoj.routers.helpers import send_message_to_model_wrapper
22
- from khoj.utils.helpers import is_none_or_empty, timer, truncate_code_context
23
+ from khoj.utils.helpers import is_none_or_empty, timer
23
24
  from khoj.utils.rawconfig import LocationData
24
25
 
25
26
  logger = logging.getLogger(__name__)
@@ -179,3 +180,26 @@ async def execute_sandboxed_python(code: str, input_data: list[dict], sandbox_ur
179
180
  "std_err": f"Failed to execute code with {response.status}",
180
181
  "output_files": [],
181
182
  }
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