khoj 1.29.1.dev1__py3-none-any.whl → 1.29.2.dev5__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 (42) hide show
  1. khoj/interface/compiled/404/index.html +1 -1
  2. khoj/interface/compiled/_next/static/chunks/{8423-ebfa9bb9e2424ca3.js → 8423-ffdc2b835629c7f8.js} +1 -1
  3. khoj/interface/compiled/_next/static/chunks/app/agents/{page-4353b1a532795ad1.js → page-ee4f0da14df15091.js} +1 -1
  4. khoj/interface/compiled/_next/static/chunks/app/automations/{page-c9f13c865e739607.js → page-da59a2b9ec07da16.js} +1 -1
  5. khoj/interface/compiled/_next/static/chunks/app/chat/page-e95e87da53d725a7.js +1 -0
  6. khoj/interface/compiled/_next/static/chunks/app/{page-ecb8e1c192aa8834.js → page-774dcd8ca4459c7e.js} +1 -1
  7. khoj/interface/compiled/_next/static/chunks/app/search/{page-8e28deacb61f75aa.js → page-4f44549ba3807021.js} +1 -1
  8. khoj/interface/compiled/_next/static/chunks/app/settings/{page-610d33158b233b34.js → page-5591490850437232.js} +1 -1
  9. khoj/interface/compiled/_next/static/chunks/app/share/chat/page-3a752baa5fb62e20.js +1 -0
  10. khoj/interface/compiled/_next/static/chunks/{webpack-1a1965c8ec904e57.js → webpack-d37377886a1b4e56.js} +1 -1
  11. khoj/interface/compiled/_next/static/css/2ff098d0815fdbc1.css +1 -0
  12. khoj/interface/compiled/_next/static/css/4cae6c0e5c72fb2d.css +1 -0
  13. khoj/interface/compiled/agents/index.html +1 -1
  14. khoj/interface/compiled/agents/index.txt +2 -2
  15. khoj/interface/compiled/automations/index.html +1 -1
  16. khoj/interface/compiled/automations/index.txt +2 -2
  17. khoj/interface/compiled/chat/index.html +1 -1
  18. khoj/interface/compiled/chat/index.txt +2 -2
  19. khoj/interface/compiled/index.html +1 -1
  20. khoj/interface/compiled/index.txt +2 -2
  21. khoj/interface/compiled/search/index.html +1 -1
  22. khoj/interface/compiled/search/index.txt +2 -2
  23. khoj/interface/compiled/settings/index.html +1 -1
  24. khoj/interface/compiled/settings/index.txt +2 -2
  25. khoj/interface/compiled/share/chat/index.html +1 -1
  26. khoj/interface/compiled/share/chat/index.txt +2 -2
  27. khoj/processor/conversation/anthropic/anthropic_chat.py +1 -1
  28. khoj/processor/conversation/google/gemini_chat.py +1 -1
  29. khoj/processor/tools/run_code.py +29 -2
  30. khoj/routers/api_content.py +12 -2
  31. khoj/routers/research.py +2 -2
  32. {khoj-1.29.1.dev1.dist-info → khoj-1.29.2.dev5.dist-info}/METADATA +2 -1
  33. {khoj-1.29.1.dev1.dist-info → khoj-1.29.2.dev5.dist-info}/RECORD +38 -38
  34. {khoj-1.29.1.dev1.dist-info → khoj-1.29.2.dev5.dist-info}/WHEEL +1 -1
  35. khoj/interface/compiled/_next/static/chunks/app/chat/page-45720e1ed71e3ef5.js +0 -1
  36. khoj/interface/compiled/_next/static/chunks/app/share/chat/page-30376aa7e9cfa342.js +0 -1
  37. khoj/interface/compiled/_next/static/css/23f801d22927d568.css +0 -1
  38. khoj/interface/compiled/_next/static/css/592ca99f5122e75a.css +0 -1
  39. /khoj/interface/compiled/_next/static/{2lvMys9JZIzwqRwdWMyNe → bIVLxe5g7EDG455p-cfe7}/_buildManifest.js +0 -0
  40. /khoj/interface/compiled/_next/static/{2lvMys9JZIzwqRwdWMyNe → bIVLxe5g7EDG455p-cfe7}/_ssgManifest.js +0 -0
  41. {khoj-1.29.1.dev1.dist-info → khoj-1.29.2.dev5.dist-info}/entry_points.txt +0 -0
  42. {khoj-1.29.1.dev1.dist-info → khoj-1.29.2.dev5.dist-info}/licenses/LICENSE +0 -0
@@ -1,4 +1,5 @@
1
1
  import base64
2
+ import copy
2
3
  import datetime
3
4
  import json
4
5
  import logging
@@ -88,7 +89,8 @@ async def run_code(
88
89
  with timer("Chat actor: Execute generated program", logger, log_level=logging.INFO):
89
90
  result = await execute_sandboxed_python(generated_code.code, input_data, sandbox_url)
90
91
  code = result.pop("code")
91
- logger.info(f"Executed Code:\n--@@--\n{code}\n--@@--Result:\n--@@--\n{result}\n--@@--")
92
+ cleaned_result = truncate_code_context({"cleaned": {"results": result}})["cleaned"]["results"]
93
+ logger.info(f"Executed Code\n----\n{code}\n----\nResult\n----\n{cleaned_result}\n----")
92
94
  yield {query: {"code": code, "results": result}}
93
95
  except Exception as e:
94
96
  raise ValueError(f"Failed to run code for {query} with error: {e}")
@@ -163,7 +165,8 @@ async def execute_sandboxed_python(code: str, input_data: list[dict], sandbox_ur
163
165
  result: dict[str, Any] = await response.json()
164
166
  result["code"] = cleaned_code
165
167
  # Store decoded output files
166
- for output_file in result.get("output_files", []):
168
+ result["output_files"] = result.get("output_files", [])
169
+ for output_file in result["output_files"]:
167
170
  # Decode text files as UTF-8
168
171
  if mimetypes.guess_type(output_file["filename"])[0].startswith("text/") or Path(
169
172
  output_file["filename"]
@@ -175,4 +178,28 @@ async def execute_sandboxed_python(code: str, input_data: list[dict], sandbox_ur
175
178
  "code": cleaned_code,
176
179
  "success": False,
177
180
  "std_err": f"Failed to execute code with {response.status}",
181
+ "output_files": [],
178
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
@@ -422,8 +422,18 @@ async def convert_documents(
422
422
  f"Page {index} of {file_data.name}:\n\n{entry}" for index, entry in enumerate(entries_per_page)
423
423
  ]
424
424
  extracted_content = "\n".join(annotated_pages)
425
-
426
- size_in_bytes = len(extracted_content.encode("utf-8"))
425
+ else:
426
+ # Convert content to string
427
+ extracted_content = extracted_content.decode("utf-8")
428
+
429
+ # Calculate size in bytes. Some of the content might be in bytes, some in str.
430
+ if isinstance(extracted_content, str):
431
+ size_in_bytes = len(extracted_content.encode("utf-8"))
432
+ elif isinstance(extracted_content, bytes):
433
+ size_in_bytes = len(extracted_content)
434
+ else:
435
+ size_in_bytes = 0
436
+ logger.warning(f"Unexpected content type: {type(extracted_content)}")
427
437
 
428
438
  converted_files.append(
429
439
  {
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
19
+ from khoj.processor.tools.run_code import run_code, truncate_code_context
20
20
  from khoj.routers.api import extract_references_and_questions
21
21
  from khoj.routers.helpers import (
22
22
  ChatEvent,
@@ -348,7 +348,7 @@ async def execute_information_collection(
348
348
  if online_results:
349
349
  results_data += f"\n<online_results>\n{yaml.dump(online_results, allow_unicode=True, sort_keys=False, default_flow_style=False)}\n</online_results>"
350
350
  if code_results:
351
- results_data += f"\n<code_results>\n{yaml.dump(code_results, allow_unicode=True, sort_keys=False, default_flow_style=False)}\n</code_results>"
351
+ results_data += f"\n<code_results>\n{yaml.dump(truncate_code_context(code_results), allow_unicode=True, sort_keys=False, default_flow_style=False)}\n</code_results>"
352
352
  if summarize_files:
353
353
  results_data += f"\n<summarized_files>\n{yaml.dump(summarize_files, allow_unicode=True, sort_keys=False, default_flow_style=False)}\n</summarized_files>"
354
354
  if this_iteration.warning:
@@ -1,11 +1,12 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: khoj
3
- Version: 1.29.1.dev1
3
+ Version: 1.29.2.dev5
4
4
  Summary: Your Second Brain
5
5
  Project-URL: Homepage, https://khoj.dev
6
6
  Project-URL: Documentation, https://docs.khoj.dev
7
7
  Project-URL: Code, https://github.com/khoj-ai/khoj
8
8
  Author: Debanjum Singh Solanky, Saba Imran
9
+ License: AGPL-3.0-or-later
9
10
  Keywords: AI,NLP,images,markdown,org-mode,pdf,productivity,search,semantic-search
10
11
  Classifier: Development Status :: 5 - Production/Stable
11
12
  Classifier: Intended Audience :: Information Technology
@@ -111,17 +111,17 @@ khoj/interface/compiled/chat.svg,sha256=l2JoYRRgk201adTTdvJ-buKUrc0WGfsudix5xEvt
111
111
  khoj/interface/compiled/close.svg,sha256=hQ2iFLkNzHk0_iyTrSbwnWAeXYlgA-c2Eof2Iqh76n4,417
112
112
  khoj/interface/compiled/copy-button-success.svg,sha256=byqWAYD3Pn9IOXRjOKudJ-TJbP2UESbQGvtLWazNGjY,829
113
113
  khoj/interface/compiled/copy-button.svg,sha256=05bKM2eRxksfBlAPT7yMaoNJEk85bZCxQg67EVrPeHo,669
114
- khoj/interface/compiled/index.html,sha256=GviaSKaRKkkFHNoUvO4wnVIpKOJ5Vyxw4lU50VFEFNM,12156
115
- khoj/interface/compiled/index.txt,sha256=WSKlip2DgGxxQELYHJt1BvLlUuUJe10gw_A8NFCbQvs,5611
114
+ khoj/interface/compiled/index.html,sha256=phsPSWlQeBTK9qRgVVZxEJbtDOs5e5xwgsWadlNUNYU,12156
115
+ khoj/interface/compiled/index.txt,sha256=aBDwEEUg6io43NMPPSCYck5n5PP0FKu1jP7bH_wa8B4,5611
116
116
  khoj/interface/compiled/khoj.webmanifest,sha256=lsknYkvEdMbRTOUYKXPM_8krN2gamJmM4u3qj8u9lrU,1682
117
117
  khoj/interface/compiled/logo.svg,sha256=_QCKVYM4WT2Qhcf7aVFImjq_s5CwjynGXYAOgI7yf8w,8059
118
118
  khoj/interface/compiled/send.svg,sha256=VdavOWkVddcwcGcld6pdfmwfz7S91M-9O28cfeiKJkM,635
119
119
  khoj/interface/compiled/share.svg,sha256=91lwo75PvMDrgocuZQab6EQ62CxRbubh9Bhw7CWMKbg,1221
120
120
  khoj/interface/compiled/thumbs-down.svg,sha256=JGNl-DwoRmH2XFMPWwFFklmoYtKxaQbkLE3nuYKe8ZY,1019
121
121
  khoj/interface/compiled/thumbs-up.svg,sha256=yS1wxTRtiztkN-6nZciLoYQUB_KTYNPV8xFRwH2TQFw,1036
122
- khoj/interface/compiled/404/index.html,sha256=w03asQtqjZelHMwfwWzgx31ECWnvuLxCgZGr52vp5XE,12023
123
- khoj/interface/compiled/_next/static/2lvMys9JZIzwqRwdWMyNe/_buildManifest.js,sha256=6I9QUstNpJnhe3leR2Daw0pSXwzcbBscv6h2jmmPpms,224
124
- khoj/interface/compiled/_next/static/2lvMys9JZIzwqRwdWMyNe/_ssgManifest.js,sha256=Z49s4suAsf5y_GfnQSvm4qtq2ggxEbZPfEDTXjy6XgA,80
122
+ khoj/interface/compiled/404/index.html,sha256=CcFnOA-B6eMXL_GIr9bgaPYM4ACB2vrFjyfejGvYClk,12023
123
+ khoj/interface/compiled/_next/static/bIVLxe5g7EDG455p-cfe7/_buildManifest.js,sha256=6I9QUstNpJnhe3leR2Daw0pSXwzcbBscv6h2jmmPpms,224
124
+ khoj/interface/compiled/_next/static/bIVLxe5g7EDG455p-cfe7/_ssgManifest.js,sha256=Z49s4suAsf5y_GfnQSvm4qtq2ggxEbZPfEDTXjy6XgA,80
125
125
  khoj/interface/compiled/_next/static/chunks/1210.132a7e1910006bbb.js,sha256=2dJueIfOg5qlQdanOM9HrgwcfrUXCD57bfd8Iv7iJcU,2104
126
126
  khoj/interface/compiled/_next/static/chunks/1279-f37ee4a388ebf544.js,sha256=U_1WaocOdgJ4HZB8tRx_izzYGD1EZlCohC1uLCffCWc,45582
127
127
  khoj/interface/compiled/_next/static/chunks/1459.690bf20e7d7b7090.js,sha256=z-ruZPxF_Z3ef_WOThd9Ox36AMhxaW3znizVivNnA34,34239
@@ -139,7 +139,7 @@ khoj/interface/compiled/_next/static/chunks/5961-3c104d9736b7902b.js,sha256=qss4
139
139
  khoj/interface/compiled/_next/static/chunks/6297-d1c842ed3f714ab0.js,sha256=4nzZ2umR-q6wQ-8L4RSivWXKV_SE1dWoN9qA1I9lCRI,25675
140
140
  khoj/interface/compiled/_next/static/chunks/7023-a5bf5744d19b3bd3.js,sha256=TBJA7dTnI8nymtbljKuZzo2hbStXWR-P8Qkl57k2Tw8,123898
141
141
  khoj/interface/compiled/_next/static/chunks/7883-b1305ec254213afe.js,sha256=dDbERTNiKRIIdC7idybjZq03gnxQtudMawrekye0zH8,241134
142
- khoj/interface/compiled/_next/static/chunks/8423-ebfa9bb9e2424ca3.js,sha256=VwlClSlEVvw6VpjDyK5k8J7CegYcJ9VEMUajAyQo3PA,14909
142
+ khoj/interface/compiled/_next/static/chunks/8423-ffdc2b835629c7f8.js,sha256=e2jAWQ-jQxP-067cJlzMogEtg-UwLZxrg9DP4DHstng,15238
143
143
  khoj/interface/compiled/_next/static/chunks/9001-3b27af6d5f21df44.js,sha256=ran2mMGTO2kiAJebRGMyfyAu4Sdjw-WobS_m6g-qjz8,34223
144
144
  khoj/interface/compiled/_next/static/chunks/9417-32c4db52ca42e681.js,sha256=9r3lV-DxmhmQnYjroVbjAXPyX6rvSmhZKfUguE0dENw,15039
145
145
  khoj/interface/compiled/_next/static/chunks/94ca1967.5584df65931cfe83.js,sha256=lxdrZ8h3_IWkTuk6QlzM2Hd9Pvu9_p8h_EI4aveSOgE,1174519
@@ -150,29 +150,29 @@ khoj/interface/compiled/_next/static/chunks/framework-8e0e0f4a6b83a956.js,sha256
150
150
  khoj/interface/compiled/_next/static/chunks/main-1ea5c2e0fdef4626.js,sha256=8_u87PGI3PahFbDfGWGvpD-a18J7X7ChUqWIeqxVq7g,111061
151
151
  khoj/interface/compiled/_next/static/chunks/main-app-6d6ee3495efe03d4.js,sha256=i52E7sWOcSq1G8eYZL3mtTxbUbwRNxcAbSWQ6uWpMsY,475
152
152
  khoj/interface/compiled/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js,sha256=6QPOwdWeAVe8x-SsiDrm-Ga6u2DkqgG5SFqglrlyIgA,91381
153
- khoj/interface/compiled/_next/static/chunks/webpack-1a1965c8ec904e57.js,sha256=NGIUyAbWbYTDIe6_USp6wzmgECdC748v5e2Vrnwu3ro,4054
153
+ khoj/interface/compiled/_next/static/chunks/webpack-d37377886a1b4e56.js,sha256=uZx5Rho2ddFBfyZSvMYSu3v0CVZ6bZaB5oKzHGSvIbE,4054
154
154
  khoj/interface/compiled/_next/static/chunks/app/layout-86561d2fac35a91a.js,sha256=2EWsyKE2kcC5uDvsOtgG5OP0hHCX8sCph4NqhUU2rCg,442
155
- khoj/interface/compiled/_next/static/chunks/app/page-ecb8e1c192aa8834.js,sha256=37-5NzGAsEBxSfvd9BOxTWwAi6c-3Gv101QCqFYtMzo,29633
155
+ khoj/interface/compiled/_next/static/chunks/app/page-774dcd8ca4459c7e.js,sha256=ueEIbfyWJZsqjAz2b1gQBAEEyHek-hbiehBpxswXRnc,29683
156
156
  khoj/interface/compiled/_next/static/chunks/app/_not-found/page-07ff4ab42b07845e.js,sha256=3mCUnxfMxyK44eqk21TVBrC6u--WSbvx31fTmQuOvMQ,1755
157
157
  khoj/interface/compiled/_next/static/chunks/app/agents/layout-e9838b642913a071.js,sha256=w3vWDf7m2_VG7q98_KGAWbCO06RI7iqFYsb4nDqGUDw,372
158
- khoj/interface/compiled/_next/static/chunks/app/agents/page-4353b1a532795ad1.js,sha256=VYSOSTRUsJQxg-C2ntEbHW5Fwm_a5k1e79bUYlcZBa0,11755
158
+ khoj/interface/compiled/_next/static/chunks/app/agents/page-ee4f0da14df15091.js,sha256=uqFdU7KMW0ZqRQySoGhRNXTHvodXxMC34a1zhr47vVs,11750
159
159
  khoj/interface/compiled/_next/static/chunks/app/automations/layout-27c28e923c9b1ff0.js,sha256=d2vJ_lVB0pfeFXNUPzHAe1ca5NzdNowHPh___SPqugM,5143
160
- khoj/interface/compiled/_next/static/chunks/app/automations/page-c9f13c865e739607.js,sha256=hkZk61Vrde0LIL4KPqnm_u2pd_LPzvt-f6Z0hkq8FCs,35344
160
+ khoj/interface/compiled/_next/static/chunks/app/automations/page-da59a2b9ec07da16.js,sha256=R7auC6hEUsXt6aysFhuyAEcGGUaZ4QOnLxxc8XdDSbc,35349
161
161
  khoj/interface/compiled/_next/static/chunks/app/chat/layout-b0e7ff4baa3b5265.js,sha256=a-Qv2nHUrCa1gIs4Qo5txnOlhhQessAdcnAhhjaN3ag,374
162
- khoj/interface/compiled/_next/static/chunks/app/chat/page-45720e1ed71e3ef5.js,sha256=gPlxB-cSg3pd0yguoe8M44gHzLY4ET-Pbhsok7xtBQw,6632
162
+ khoj/interface/compiled/_next/static/chunks/app/chat/page-e95e87da53d725a7.js,sha256=-2zXrMu8g66gPw4jsGKbeplGd8rXMlkqfsG8qAOtGf4,7181
163
163
  khoj/interface/compiled/_next/static/chunks/app/search/layout-ea6b73fdaf9b24ca.js,sha256=mBgNUjaTBNgIKOpZj722mh1ojg1CNIYRBPiupStSS6s,165
164
- khoj/interface/compiled/_next/static/chunks/app/search/page-8e28deacb61f75aa.js,sha256=A3klMSdb4sxIAuHZ8NdbYgzc_WXhzIPFACF-D4CRino,6958
164
+ khoj/interface/compiled/_next/static/chunks/app/search/page-4f44549ba3807021.js,sha256=3O3gUM_ALtxAqNVAwQ9X_FDedXFYEcNWEqndayZeTBY,6958
165
165
  khoj/interface/compiled/_next/static/chunks/app/settings/layout-254eaaf916449a60.js,sha256=kHAKleDbNFfhNM3e1WLJm3OFw6PDtGcjyj5toO24vps,5347
166
- khoj/interface/compiled/_next/static/chunks/app/settings/page-610d33158b233b34.js,sha256=gvcwqYV9CrC5M3KBpyn0b88m8u34brimEEYC0Z8ExiI,32149
166
+ khoj/interface/compiled/_next/static/chunks/app/settings/page-5591490850437232.js,sha256=p0kRFoAYcSHSxG2y8JOaUBU-Xc__jwCIbYrUs_NEJu8,32149
167
167
  khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-cf7445cf0326bda3.js,sha256=W3axh1K4y-pLSXcXogLl4qLKXr5BZLY1uA7JfSWp5TU,373
168
- khoj/interface/compiled/_next/static/chunks/app/share/chat/page-30376aa7e9cfa342.js,sha256=97knuZITimK5C-hRzxFUVwudgQ-jMVN1uNEaN9u75TU,4351
168
+ khoj/interface/compiled/_next/static/chunks/app/share/chat/page-3a752baa5fb62e20.js,sha256=gIcgm8Wtf38E8fP2jE58mPYm2GLOL5WU7HRxONXrK1g,4376
169
169
  khoj/interface/compiled/_next/static/chunks/pages/_app-f870474a17b7f2fd.js,sha256=eqdFPAN_XFyMUzZ9qwFk-_rhMWZrU7lgNVt1foVUANo,286
170
170
  khoj/interface/compiled/_next/static/chunks/pages/_error-c66a4e8afc46f17b.js,sha256=vjERjtMAbVk-19LyPf1Jc-H6TMcrSznSz6brzNqbqf8,253
171
171
  khoj/interface/compiled/_next/static/css/0e9d53dcd7f11342.css,sha256=52_LSJ59Vwm1p2UpcDXEvq99pTjz2sW4EjF5iKf-dzs,2622
172
172
  khoj/interface/compiled/_next/static/css/1f293605f2871853.css,sha256=G2b3Wx4e0DRBWSdNU20ivCChZI5HBzvPYUVVIdTRjLc,26590
173
- khoj/interface/compiled/_next/static/css/23f801d22927d568.css,sha256=vVeNg0xTNJbdrtpZNuFCvNJPW5An06hr7i2M6yDXjK4,8449
173
+ khoj/interface/compiled/_next/static/css/2ff098d0815fdbc1.css,sha256=F-uRnbKKlMZq5eMcvFZtUOCTgC6n_uNE6fuaHU4CBak,8829
174
174
  khoj/interface/compiled/_next/static/css/3cf13271869a4aeb.css,sha256=sGjJTeMeN6wbQF4OCPgWYgJmSLLSHyzIH2rSVstWx7k,1857
175
- khoj/interface/compiled/_next/static/css/592ca99f5122e75a.css,sha256=BSqRkeb9vBh0phx5GkAlZirTFZintbyggGaUkuOBfaU,914
175
+ khoj/interface/compiled/_next/static/css/4cae6c0e5c72fb2d.css,sha256=3CjTMmtMrm_MYt1ywtUh2MHEjSLSl356SQLl4hdBuYw,534
176
176
  khoj/interface/compiled/_next/static/css/5a400c87d295e68a.css,sha256=ojDUPJ9fJpEo9DzTAsEa-k1cg7Bef-nSTfpszMiqknQ,17711
177
177
  khoj/interface/compiled/_next/static/css/80bd6301fc657983.css,sha256=T7_aQHcWpQBQLKadauHNzjYGw713FtRNTlUqmJjsL6I,1634
178
178
  khoj/interface/compiled/_next/static/css/ed437164d77aa600.css,sha256=l7axYkpTLwbVjhTCUNh8BWdkBom06sG-JrpDX5vSPUU,3056024
@@ -248,8 +248,8 @@ khoj/interface/compiled/_next/static/media/flags.3afdda2f.webp,sha256=M2AW_HLpBn
248
248
  khoj/interface/compiled/_next/static/media/flags@2x.5fbe9fc1.webp,sha256=BBeRPBZkxY3-aKkMnYv5TSkxmbeMbyUH4VRIPfrWg1E,137406
249
249
  khoj/interface/compiled/_next/static/media/globe.98e105ca.webp,sha256=g3ofb8-W9GM75zIhlvQhaS8I2py9TtrovOKR3_7Jf04,514
250
250
  khoj/interface/compiled/_next/static/media/globe@2x.974df6f8.webp,sha256=I_N7Yke3IOoS-0CC6XD8o0IUWG8PdPbrHmf6lpgWlZY,1380
251
- khoj/interface/compiled/agents/index.html,sha256=i7JAEow0Qg96KTAYGvO_GRlWMNMhumQJ845fjecXXVs,12966
252
- khoj/interface/compiled/agents/index.txt,sha256=2R2KTj-qXF3LiAYQHvop8bM3Uf6Bn22xWfm5HymFWKc,6178
251
+ khoj/interface/compiled/agents/index.html,sha256=PW1EP2bWPYYpHUoi0Bj2VA7DqUTc788geqFgTUiAjWE,12658
252
+ khoj/interface/compiled/agents/index.txt,sha256=NYEusCcSS7ptQDq5EUfe_oaSMxHkND6lNMfy2Wu9Aik,6045
253
253
  khoj/interface/compiled/assets/icons/khoj_lantern.ico,sha256=eggu-B_v3z1R53EjOFhIqqPnICBGdoaw1xnc0NrzHck,174144
254
254
  khoj/interface/compiled/assets/icons/khoj_lantern_128x128.png,sha256=aTxivDb3CYyThkVZWz8A19xl_dNut5DbkXhODWF3A9Q,5640
255
255
  khoj/interface/compiled/assets/icons/khoj_lantern_256x256.png,sha256=xPCMLHiaL7lYOdQLZrKwWE-Qjn5ZaysSZB0ScYv4UZU,12312
@@ -260,16 +260,16 @@ khoj/interface/compiled/assets/samples/desktop-remember-plan-sample.png,sha256=i
260
260
  khoj/interface/compiled/assets/samples/phone-browse-draw-sample.png,sha256=Dd4fPwtFl6BWqnHjeb1mCK_ND0hhHsWtx8sNE7EiMuE,406179
261
261
  khoj/interface/compiled/assets/samples/phone-plain-chat-sample.png,sha256=DEDaNRCkfEWUeh3kYZWIQDTVK1a6KKnYdwj5ZWisN_Q,82985
262
262
  khoj/interface/compiled/assets/samples/phone-remember-plan-sample.png,sha256=Ma3blirRmq3X4oYSsDbbT7MDn29rymDrjwmUfA9BMuM,236285
263
- khoj/interface/compiled/automations/index.html,sha256=EzcSNYCim5U8b3HJBqkUUMXJIncEWca9d5_cmm09zZU,30633
264
- khoj/interface/compiled/automations/index.txt,sha256=YI5K3Ko-qRlGZViapJqqArA26mtwTgCEuv7bZCqvkfw,5500
265
- khoj/interface/compiled/chat/index.html,sha256=wlcw8f7GAsRQ4MYjOEJ3RJq64OX-ZL4gyWOBJCgDQ8Q,13860
266
- khoj/interface/compiled/chat/index.txt,sha256=jsNp5j2nLVrkYYnJx3vNono0Mu8m882bn4Wo8y-PZgE,6590
267
- khoj/interface/compiled/search/index.html,sha256=8sfPOunHaf6oquzqQB0cLY3zbS4UxsbJY5B0DdzJ4lA,30161
268
- khoj/interface/compiled/search/index.txt,sha256=3Zs26zLe3EFeCcE9zN8AFMSc91HX9BD4A5sR1WaKvQ0,5256
269
- khoj/interface/compiled/settings/index.html,sha256=byqpLbRyEBfgylv1FJd5JRe2MPs5CLSSmTQC3X0Pum4,12831
270
- khoj/interface/compiled/settings/index.txt,sha256=1fjspCqYdXGmugDd-xuDtfACW9Ahw-QiK7pmz1XLn58,6078
271
- khoj/interface/compiled/share/chat/index.html,sha256=oLKTH5VjPs0QPnauv2kTOq84SetiVPbxsW_mMf2Q5mg,15157
272
- khoj/interface/compiled/share/chat/index.txt,sha256=wTo8iBme_gKVeWZ7QY43bkdyQTj5PGfFbVeL77T9FXc,7387
263
+ khoj/interface/compiled/automations/index.html,sha256=c7BJGXDZfx-lLMmnseGmVisbJJrp9VsS8cUV_Cq6Fkw,30941
264
+ khoj/interface/compiled/automations/index.txt,sha256=CzLja08Sht7ES0OZ8uU2HPi7W04UeUKHXOROFnlGFmo,5633
265
+ khoj/interface/compiled/chat/index.html,sha256=CaW_I1YNcAm7cUTVq68ir3PrqJvyFJXsn1wXP5Ciwdw,13860
266
+ khoj/interface/compiled/chat/index.txt,sha256=4EGC55bMvXrVMFx4h-WVxJir9i5H_39aecZKvpE0xeA,6590
267
+ khoj/interface/compiled/search/index.html,sha256=gupaUQA80tHAoy6nDT7RV3TC074bYoe-zY-Sh-jNwPY,30161
268
+ khoj/interface/compiled/search/index.txt,sha256=sI_qcZ48itrA80_uvfvKiVwR0tka2xBJ5_cXRcHibZU,5256
269
+ khoj/interface/compiled/settings/index.html,sha256=6s81Ie776WybeagzRZJC3TONvT0n0P7NWMVGIRmx16Q,12831
270
+ khoj/interface/compiled/settings/index.txt,sha256=Ql3KF4IltiX1PF_c-xU5ombx8y2n4xzkioo0iG2ySnQ,6078
271
+ khoj/interface/compiled/share/chat/index.html,sha256=WtZGHfnQs5TK12nK56MDSAkrVnNZxjv0rb9lBEdBF1M,15157
272
+ khoj/interface/compiled/share/chat/index.txt,sha256=o6H0BhBz-l4j_EhCFgi_PXNL6_fEgO61QIQ6J9bovzE,7387
273
273
  khoj/interface/email/feedback.html,sha256=xksuPFamx4hGWyTTxZKRgX_eiYQQEuv-eK9Xmkt-nwU,1216
274
274
  khoj/interface/email/magic_link.html,sha256=EoGKQucfPj3xQrWXhSZAzPFOYCHF_ZX94TWCd1XHl1M,941
275
275
  khoj/interface/email/task.html,sha256=tY7a0gzVeQ2lSQNu7WyXR_s7VYeWTrxWEj1iHVuoVE4,2813
@@ -324,10 +324,10 @@ khoj/processor/conversation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMp
324
324
  khoj/processor/conversation/prompts.py,sha256=jXVxeFYHBP6LBSAmdykYH6in297VTgVdEJ5IDsYlQnI,50319
325
325
  khoj/processor/conversation/utils.py,sha256=sp9NjsP6dl1RMlcmX4GGZTD9bIUozXr9OD6gDvxxLV4,27635
326
326
  khoj/processor/conversation/anthropic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
327
- khoj/processor/conversation/anthropic/anthropic_chat.py,sha256=JjKiMY8CYv7kp2gHo7HcB-rMP5kokSutPw6w2OOURd4,8678
327
+ khoj/processor/conversation/anthropic/anthropic_chat.py,sha256=4QE0sa6Oqq_rpKp7Xj24ta2zCVr_H2p_LhIDlLqZZxI,8701
328
328
  khoj/processor/conversation/anthropic/utils.py,sha256=6_FnsfLRqjkubkfMVmPTEEBzvMUOAccIz5AHV6B9mU8,6623
329
329
  khoj/processor/conversation/google/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
330
- khoj/processor/conversation/google/gemini_chat.py,sha256=JoGmLZRic96ODnz0sMb8MGPQbBRPd2IOC2-Ak88jwtc,8879
330
+ khoj/processor/conversation/google/gemini_chat.py,sha256=hGdC9uBNpi0eHoOwzZA_2gUrEgdWCODx-PiFqarCVYc,8902
331
331
  khoj/processor/conversation/google/utils.py,sha256=-Z5crXL6-xJraEX4qShbI3Y4PAqKi55PEWiEDPSi-LM,10205
332
332
  khoj/processor/conversation/offline/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
333
333
  khoj/processor/conversation/offline/chat_model.py,sha256=BiH-p6CigmZSXNzs6oNvjcYeiSEsVTRPdTPH0oTPPlM,11000
@@ -342,12 +342,12 @@ khoj/processor/speech/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
342
342
  khoj/processor/speech/text_to_speech.py,sha256=Q7sapi5Hv6woXOumtrGqR0t6izZrFBkWXFOGrHM6dJ4,1929
343
343
  khoj/processor/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
344
344
  khoj/processor/tools/online_search.py,sha256=uxwtvKReGEW1XhkeToi7XB_oZ301DIcnD7Wr3xojuM4,16307
345
- khoj/processor/tools/run_code.py,sha256=f8_oXLjBLscnnE9BJorOdFQsegk9wVWb-yUuyPvd60A,6347
345
+ khoj/processor/tools/run_code.py,sha256=i9ce53dw0y5ZNhPorRNYJieIKw6eyrZQX0ABDrWiW8M,7738
346
346
  khoj/routers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
347
347
  khoj/routers/api.py,sha256=_AI1pnQMQM75L6WVZSAVfvrk04pLEdLbHA0fkyxnUbo,28489
348
348
  khoj/routers/api_agents.py,sha256=vHPruCjlQxGBdm0lcmymEb9-aAELqbOplqh21WwD0DQ,9699
349
349
  khoj/routers/api_chat.py,sha256=83jqlGex6K3bry9_Pq4Ti8pEGHhENsjtlW4EgWbL-88,48704
350
- khoj/routers/api_content.py,sha256=10dw55vesCsuci577OCYgYylWgmIDA45Iax1ZQ8dnGI,20544
350
+ khoj/routers/api_content.py,sha256=WNlB6lVwRW8hHDthO2HypbpPvqrqt9rTU5oMRNknpMU,21070
351
351
  khoj/routers/api_model.py,sha256=KDsxNwHspC94eTcv6l3ehr773EOvgc670UnZLE1WZ4o,3642
352
352
  khoj/routers/api_phone.py,sha256=p9yfc4WeMHDC0hg3aQk60a2VBy8rZPdEnz9wdJ7DzkU,2208
353
353
  khoj/routers/api_subscription.py,sha256=J6xZNZDdOA71vCfethlPfAyfvRBq4HGCBpbsOZ9CWj0,5333
@@ -355,7 +355,7 @@ khoj/routers/auth.py,sha256=HO54PR-BkWA_iJIktEobUrObcXVYG-00jpnIcEVdR5s,6564
355
355
  khoj/routers/email.py,sha256=SGYNPQvfcvYeHf70F0YqpY0FLMRElF2ZekROXdwGI18,3821
356
356
  khoj/routers/helpers.py,sha256=v-dnh2AwuXQNCWGHYLacGnq-8bNSluU2Ym8z7JG4ek0,82672
357
357
  khoj/routers/notion.py,sha256=g53xyYFmjr2JnuIrTW2vytbfkiK_UkoRTxqnnLSmD5o,2802
358
- khoj/routers/research.py,sha256=e_p2Rj9ypryCdgCb9fhNldzf57gWQN99eDy1aOTk1yU,15675
358
+ khoj/routers/research.py,sha256=lWD7ZLkgRUh2rxmjhzj9RIuibixNrbeqSzlLCEda1aI,15721
359
359
  khoj/routers/storage.py,sha256=tJrwhFRVWv0MHv7V7huMc1Diwm-putZSwnZXJ3tqT_c,2338
360
360
  khoj/routers/twilio.py,sha256=MLsuCm4--ETvr3sLxbF0CL_ehlg_l2rKBSLR2Qh2Xls,1081
361
361
  khoj/routers/web_client.py,sha256=frH03Sh0AR7c2MvRyc5a3tOFyxyVak3d1pl1sLcLLD4,4212
@@ -378,8 +378,8 @@ khoj/utils/models.py,sha256=Q5tcC9-z25sCiub048fLnvZ6_IIO1bcPNxt5payekk0,2009
378
378
  khoj/utils/rawconfig.py,sha256=bQ_MGbBzYt6ZUIsHUwZjaHKDLh6GQ7h-sENkv3fyVbQ,5028
379
379
  khoj/utils/state.py,sha256=KtUEIKAZdGGN_Qr58RS1pgcywgSafun8YIXx-YEclAY,1645
380
380
  khoj/utils/yaml.py,sha256=qy1Tkc61rDMesBw_Cyx2vOR6H-Hngcsm5kYfjwQBwkE,1543
381
- khoj-1.29.1.dev1.dist-info/METADATA,sha256=WjCVfTl5yCqe2WcVZHTXhK81Zq3JINsUqqFPxZ3mhhM,7092
382
- khoj-1.29.1.dev1.dist-info/WHEEL,sha256=3U_NnUcV_1B1kPkYaPzN-irRckL5VW_lytn0ytO_kRY,87
383
- khoj-1.29.1.dev1.dist-info/entry_points.txt,sha256=KBIcez5N_jCgq_ER4Uxf-e1lxTBMTE_BBjMwwfeZyAg,39
384
- khoj-1.29.1.dev1.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
385
- khoj-1.29.1.dev1.dist-info/RECORD,,
381
+ khoj-1.29.2.dev5.dist-info/METADATA,sha256=Nh_eOPBR007B4US8wNq8qblBiowZYWm_PIt8qoiVHGs,7119
382
+ khoj-1.29.2.dev5.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
383
+ khoj-1.29.2.dev5.dist-info/entry_points.txt,sha256=KBIcez5N_jCgq_ER4Uxf-e1lxTBMTE_BBjMwwfeZyAg,39
384
+ khoj-1.29.2.dev5.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
385
+ khoj-1.29.2.dev5.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.26.1
2
+ Generator: hatchling 1.26.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1929],{39929:function(e,t,s){Promise.resolve().then(s.bind(s,38874))},38874:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return p}});var a=s(57437),o=s(65104),n=s.n(o),i=s(2265),r=s(48861),c=s(55538),l=s(16463),d=s(58485),u=s(9557);s(7395);var h=s(69591),m=s(38423),g=s(79306);function f(e){let t=(0,l.useSearchParams)().get("conversationId"),[s,o]=(0,i.useState)(""),[r,d]=(0,i.useState)([]),[u,h]=(0,i.useState)(!1),[g,f]=(0,i.useState)(null),[p,_]=(0,i.useState)(!1),x=(0,i.useRef)(null),y=e.setQueryToProcess,w=e.onConversationIdChange,S=e.isMobileWidth?"w-full":"w-4/6";if((0,i.useEffect)(()=>{if(r.length>0){let t=r.map(e=>encodeURIComponent(e));e.setImages(t)}},[r,e.setImages]),(0,i.useEffect)(()=>{let t=localStorage.getItem("images");if(t){let s=JSON.parse(t);d(s);let a=s.map(e=>encodeURIComponent(e));e.setImages(a),localStorage.removeItem("images")}let s=localStorage.getItem("message");s&&(h(!0),y(s),s.trim().startsWith("/research")&&_(!0));let a=localStorage.getItem("uploadedFiles");if(a){let t=a?JSON.parse(a):[],s=[];for(let e of t)s.push({name:e.name,file_type:e.file_type,content:e.content,size:e.size});localStorage.removeItem("uploadedFiles"),e.setUploadedFiles(s)}},[y,e.setImages,t]),(0,i.useEffect)(()=>{s&&(h(!0),y(s))},[s,y]),(0,i.useEffect)(()=>{t&&(null==w||w(t))},[t,w]),(0,i.useEffect)(()=>{e.streamedMessages&&e.streamedMessages.length>0&&e.streamedMessages[e.streamedMessages.length-1].completed?(h(!1),d([]),e.setUploadedFiles(void 0)):o("")},[e.streamedMessages]),!t){window.location.href="/";return}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:n().chatBodyFull,children:(0,a.jsx)(c.Z,{conversationId:t,setTitle:e.setTitle,setAgent:f,pendingMessage:u?s:"",incomingMessages:e.streamedMessages,setIncomingMessages:e.setStreamedMessages,customClassName:S})}),(0,a.jsx)("div",{className:"".concat(n().inputBox," p-1 md:px-2 shadow-md bg-background align-middle items-center justify-center dark:bg-neutral-700 dark:border-0 dark:shadow-sm rounded-t-2xl rounded-b-none md:rounded-xl h-fit ").concat(S," mr-auto ml-auto"),children:(0,a.jsx)(m.a,{agentColor:null==g?void 0:g.color,isLoggedIn:e.isLoggedIn,sendMessage:e=>o(e),sendImage:e=>d(t=>[...t,e]),sendDisabled:u,chatOptionsData:e.chatOptionsData,conversationId:t,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles,ref:x,isResearchModeEnabled:p})})]})}function p(){let e="Khoj AI - Chat",[t,s]=(0,i.useState)(null),[o,c]=(0,i.useState)(!0),[l,m]=(0,i.useState)(e),[p,_]=(0,i.useState)(null),[x,y]=(0,i.useState)([]),[w,S]=(0,i.useState)(""),[I,v]=(0,i.useState)(!1),[b,j]=(0,i.useState)(void 0),[B,C]=(0,i.useState)([]),M=(0,h.k6)()||{timezone:Intl.DateTimeFormat().resolvedOptions().timeZone},E=(0,g.GW)(),F=(0,h.IC)();async function T(e){if(!e.ok)throw Error(e.statusText);if(!e.body)throw Error("Response body is null");let t=e.body.getReader(),s=new TextDecoder,a="␃\uD83D\uDD1A␗",o="",n=[],i={},r={};for(;;){let e;let{done:c,value:l}=await t.read();if(c){S(""),v(!1),C([]),p&&(0,u.tQ)(p,m);break}for(o+=s.decode(l,{stream:!0});-1!==(e=o.indexOf(a));){let t=o.slice(0,e);if(o=o.slice(e+a.length),t){let e=x.find(e=>!e.completed);if(!e){console.error("No current message found");return}({context:n,onlineContext:i,codeContext:r}=(0,u.VK)(t,e,n,i,r)),y([...x])}}}}async function k(){if(localStorage.removeItem("message"),!w||!p)return;let e={q:w,conversation_id:p,stream:!0,...M&&{city:M.city,region:M.region,country:M.country,country_code:M.countryCode,timezone:M.timezone},...B.length>0&&{images:B},...b&&{files:b}},t=await fetch("/api/chat?client=web",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});try{await T(t)}catch(o){let e=await t.json();console.error(e);let s=x.find(e=>!e.completed);if(!s)return;let a=o.message;a.includes("Error in input stream")?s.rawResponse="Woops! The connection broke while I was writing my thoughts down. Maybe try again in a bit or dislike this message if the issue persists?":429===t.status?"detail"in e?s.rawResponse="".concat(e.detail):s.rawResponse="I'm a bit overwhelmed at the moment. Could you try again in a bit or dislike this message if the issue persists?":s.rawResponse="Umm, not sure what just happened. I see this error message: ".concat(a,". Could you try again or dislike this message if the issue persists?"),s.completed=!0,y([...x]),S(""),v(!1)}}return((0,i.useEffect)(()=>{fetch("/api/chat/options").then(e=>e.json()).then(e=>{c(!1),e&&s(e)}).catch(e=>{console.error(e)}),(0,h.EK)()},[]),(0,i.useEffect)(()=>{if(w){let e={rawResponse:"",trainOfThought:[],context:[],onlineContext:{},codeContext:{},completed:!1,timestamp:new Date().toISOString(),rawQuery:w||"",images:B,queryFiles:b};y(t=>[...t,e]),v(!0)}},[w]),(0,i.useEffect)(()=>{I&&k()},[I]),o)?(0,a.jsx)(d.Z,{}):(0,a.jsxs)("div",{className:"".concat(n().main," ").concat(n().chatLayout),children:[(0,a.jsx)("title",{children:"".concat(e).concat(l&&l!==e?": ".concat(l):"")}),(0,a.jsx)("div",{children:(0,a.jsx)(r.ZP,{conversationId:p,uploadedFiles:[],isMobileWidth:F})}),(0,a.jsx)("div",{className:n().chatBox,children:(0,a.jsxs)("div",{className:n().chatBoxBody,children:[!F&&p&&(0,a.jsxs)("div",{className:"".concat(n().chatTitleWrapper," text-nowrap text-ellipsis overflow-hidden max-w-screen-md grid items-top font-bold mr-8 pt-6 col-auto h-fit"),children:[l&&(0,a.jsx)("h2",{className:"text-lg text-ellipsis whitespace-nowrap overflow-x-hidden",children:l}),(0,a.jsx)(r.En,{conversationId:p,setTitle:m,sizing:"md"})]}),(0,a.jsx)(i.Suspense,{fallback:(0,a.jsx)(d.Z,{}),children:(0,a.jsx)(f,{isLoggedIn:null!==E,streamedMessages:x,setStreamedMessages:y,chatOptionsData:t,setTitle:m,setQueryToProcess:S,setUploadedFiles:j,isMobileWidth:F,onConversationIdChange:e=>{_(e)},setImages:C})})]})})]})}},16463:function(e,t,s){"use strict";var a=s(71169);s.o(a,"useRouter")&&s.d(t,{useRouter:function(){return a.useRouter}}),s.o(a,"useSearchParams")&&s.d(t,{useSearchParams:function(){return a.useSearchParams}})},65104:function(e){e.exports={main:"chat_main__8xQu5",suggestions:"chat_suggestions__m8n2t",inputBox:"chat_inputBox__LOFws",chatBodyFull:"chat_chatBodyFull__FfKEK",chatBody:"chat_chatBody__sS1LX",chatLayout:"chat_chatLayout__pR203",chatBox:"chat_chatBox__FBct_",titleBar:"chat_titleBar__R5QlK",chatBoxBody:"chat_chatBoxBody__qT_SC",agentIndicator:"chat_agentIndicator__8V55w",chatTitleWrapper:"chat_chatTitleWrapper__6ChWq"}}},function(e){e.O(0,[7812,9448,4836,3954,9001,3062,3124,3803,2261,5961,1603,9417,8423,5538,2971,7023,1744],function(){return e(e.s=39929)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3111],{91955:function(e,t,s){Promise.resolve().then(s.bind(s,5506))},5506:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return p}});var a=s(57437),o=s(11930),n=s.n(o),i=s(2265),l=s(48861),c=s(55538),d=s(58485);s(7395);var r=s(69591),h=s(79306),u=s(38423);function g(e){let[t,s]=(0,i.useState)(""),[o,l]=(0,i.useState)([]),[d,r]=(0,i.useState)(!1),[h,g]=(0,i.useState)(null),p=(0,i.useRef)(null),m=e.setQueryToProcess,f=e.streamedMessages,_=e.isMobileWidth?"w-full":"w-4/6";return((0,i.useEffect)(()=>{if(o.length>0){let t=o.map(e=>encodeURIComponent(e));e.setImages(t)}},[o,e.setImages]),(0,i.useEffect)(()=>{t&&(r(!0),m(t))},[t,m]),(0,i.useEffect)(()=>{f&&f.length>0&&f[f.length-1].completed?r(!1):s("")},[f]),e.publicConversationSlug||e.conversationId)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:n().chatBodyFull,children:(0,a.jsx)(c.Z,{publicConversationSlug:e.publicConversationSlug,conversationId:e.conversationId||"",setAgent:g,setTitle:e.setTitle,pendingMessage:d?t:"",incomingMessages:e.streamedMessages,customClassName:_})}),(0,a.jsx)("div",{className:"".concat(n().inputBox," p-1 md:px-2 shadow-md bg-background align-middle items-center justify-center dark:bg-neutral-700 dark:border-0 dark:shadow-sm rounded-t-2xl rounded-b-none md:rounded-xl h-fit ").concat(_," mr-auto ml-auto"),children:(0,a.jsx)(u.a,{isLoggedIn:e.isLoggedIn,sendMessage:e=>s(e),sendImage:e=>l(t=>[...t,e]),sendDisabled:d,chatOptionsData:e.chatOptionsData,conversationId:e.conversationId,agentColor:null==h?void 0:h.color,isMobileWidth:e.isMobileWidth,setUploadedFiles:e.setUploadedFiles,ref:p})})]}):(0,a.jsx)("div",{className:n().suggestions,children:"Whoops, nothing to see here!"})}function p(){let[e,t]=(0,i.useState)(null),[s,o]=(0,i.useState)(!0),[c,u]=(0,i.useState)("Khoj AI - Chat"),[p,m]=(0,i.useState)(void 0),[f,_]=(0,i.useState)([]),[x,v]=(0,i.useState)(""),[j,S]=(0,i.useState)(null),[C,I]=(0,i.useState)(void 0),[b,y]=(0,i.useState)([]),B=(0,h.GW)(),N=(0,r.IC)();return((0,i.useEffect)(()=>{fetch("/api/chat/options").then(e=>e.json()).then(e=>{o(!1),e&&t(e)}).catch(e=>{console.error(e)}),(0,r.EK)(),I(window.location.pathname.split("/").pop()||"")},[]),(0,i.useEffect)(()=>{j&&localStorage.setItem("uploadedFiles",JSON.stringify(j))},[j]),(0,i.useEffect)(()=>{if(x&&!p){fetch("/api/chat/share/fork?public_conversation_slug=".concat(C),{method:"POST",headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{m(e.conversation_id),localStorage.setItem("message",x),b.length>0&&localStorage.setItem("images",JSON.stringify(b)),window.location.href="/chat?conversationId=".concat(e.conversation_id)}).catch(e=>{console.error(e)});return}},[x,p,C]),s)?(0,a.jsx)(d.Z,{}):C?(0,a.jsxs)("div",{className:"".concat(n().main," ").concat(n().chatLayout),children:[(0,a.jsx)("title",{children:c}),(0,a.jsx)("div",{className:n().sidePanel,children:(0,a.jsx)(l.ZP,{conversationId:null!=p?p:null,uploadedFiles:[],isMobileWidth:N})}),(0,a.jsx)("div",{className:n().chatBox,children:(0,a.jsxs)("div",{className:n().chatBoxBody,children:[!N&&c&&(0,a.jsx)("div",{className:"".concat(n().chatTitleWrapper," text-nowrap text-ellipsis overflow-hidden max-w-screen-md grid items-top font-bold mr-8 pt-6 col-auto h-fit"),children:c&&(0,a.jsx)("h2",{className:"text-lg text-ellipsis whitespace-nowrap overflow-x-hidden",children:c})}),(0,a.jsx)(i.Suspense,{fallback:(0,a.jsx)(d.Z,{}),children:(0,a.jsx)(g,{conversationId:p,streamedMessages:f,setQueryToProcess:v,isLoggedIn:null!==B,publicConversationSlug:C,chatOptionsData:e,setTitle:u,setUploadedFiles:S,isMobileWidth:N,setImages:y})})]})})]}):(0,a.jsx)("div",{className:n().suggestions,children:"Whoops, nothing to see here!"})}},11930:function(e){e.exports={main:"sharedChat_main__7Nayy",suggestions:"sharedChat_suggestions__V8kr_",inputBox:"sharedChat_inputBox__wRW5A",chatBodyFull:"sharedChat_chatBodyFull__O1MOv",chatBody:"sharedChat_chatBody__OnHDL",chatLayout:"sharedChat_chatLayout__gutlc",chatBox:"sharedChat_chatBox__PmAPg",titleBar:"sharedChat_titleBar__vOHp_",chatBoxBody:"sharedChat_chatBoxBody__ef2Nl",agentIndicator:"sharedChat_agentIndicator__ORCl4"}}},function(e){e.O(0,[7849,9448,4836,3954,9001,3062,3124,3803,2261,5961,1603,9417,8423,5538,2971,7023,1744],function(){return e(e.s=91955)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- div.automations_automationsLayout__Atoh_{display:grid;grid-template-columns:1fr 1fr;gap:1rem}div.automations_automationCard__BKidA{display:grid;grid-template-rows:auto 1fr auto}div.automations_pageLayout__OaoYA{max-width:60vw;margin:auto auto 2rem}div.automations_sidePanel__MPciO{position:fixed;height:100%;z-index:1}@media screen and (max-width:768px){div.automations_automationsLayout__Atoh_{grid-template-columns:1fr}div.automations_pageLayout__OaoYA{max-width:90vw}div.automations_sidePanel__MPciO{position:relative;height:100%}}div.sidePanel_session__R9wgH{padding:.5rem;margin-bottom:.25rem;border-radius:.5rem;cursor:pointer;max-width:14rem;font-size:medium;display:grid;grid-template-columns:minmax(auto,400px) 1fr;gap:0}div.sidePanel_compressed__YBPtM{grid-template-columns:minmax(12rem,100%) 1fr 1fr}div.sidePanel_sessionHover__iwfo8,div.sidePanel_session__R9wgH:hover{background-color:hsla(var(--popover))}div.sidePanel_session__R9wgH:hover{color:hsla(var(--popover-foreground))}div.sidePanel_session__R9wgH a{text-decoration:none}button.sidePanel_button__ihOfG{border:none;outline:none;background-color:transparent;cursor:pointer;color:var(--main-text-color);width:24px}button.sidePanel_showMoreButton__dt9Zw{border-radius:.5rem;padding:8px}div.sidePanel_panel__VZ8ye{display:flex;flex-direction:column;padding:1rem;overflow-y:auto;max-width:auto;transition:background-color .5s}div.sidePanel_expanded__ZjTHo{gap:1rem;background-color:hsla(var(--muted));height:100%}div.sidePanel_collapsed__OjVmG{display:grid;grid-template-columns:1fr;height:-moz-fit-content;height:fit-content;padding:1rem 0 0 1rem}p.sidePanel_session__R9wgH{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;text-align:left;font-size:small}div.sidePanel_header__d5cGA{display:grid;grid-template-columns:1fr auto}div.sidePanel_profile__x0w58{display:grid;grid-template-columns:auto 1fr;gap:1rem;align-items:center;margin-top:auto}div.sidePanel_panelWrapper__k_lal{display:grid;grid-template-rows:1fr auto auto;height:100%}div.sidePanel_modalSessionsList__nKe2n{position:fixed;top:0;left:0;width:100%;height:100%;background-color:hsla(var(--frosted-background-color));z-index:1;display:flex;justify-content:center;align-items:center;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}div.sidePanel_modalSessionsList__nKe2n div.sidePanel_content__Wq20_{max-width:80%;max-height:80%;background-color:hsla(var(--frosted-background-color));overflow:auto;padding:20px;border-radius:10px}div.sidePanel_modalSessionsList__nKe2n div.sidePanel_session__R9wgH{max-width:100%;text-overflow:ellipsis}@media screen and (max-width:768px){div.sidePanel_panel__VZ8ye{padding:.25rem;width:100%}div.sidePanel_expanded__ZjTHo{z-index:1}div.sidePanel_singleReference__r9z1n{padding:4px}div.sidePanel_panelWrapper__k_lal{width:100%;padding:0 1rem}div.sidePanel_session__R9wgH.sidePanel_compressed__YBPtM{max-width:100%;display:grid;grid-template-columns:70vw auto;justify-content:space-between}div.sidePanel_session__R9wgH{max-width:100%;grid-template-columns:minmax(auto,70vw) 1fr}}menu.navMenu_menu__fqlFF a{text-decoration:none;font-size:medium;font-weight:400;padding:0 4px;border-radius:4px;display:flex;justify-self:center;margin:0;align-items:center;gap:4px}a.navMenu_selected__A__aP{background-color:hsl(var(--accent))}div.navMenu_titleBar__HJoio{display:flex;justify-content:space-between;align-content:space-evenly;align-items:start}div.navMenu_titleBar__HJoio menu{padding:0;margin:0;border-radius:.5rem;display:grid;grid-auto-flow:column;gap:32px}div.navMenu_settingsMenuProfile__3npiK img{border-radius:50%;width:32px;height:32px;margin:0}div.navMenu_settingsMenu__X2i2U{padding:0 4px;border-radius:4px;display:flex;justify-self:center;margin:0;align-items:center}div.navMenu_settingsMenuOptions__KWnLv{display:block;grid-auto-flow:row;position:absolute;background-color:var(--background-color);box-shadow:0 8px 16px 0 rgba(0,0,0,.2);top:64px;text-align:left;padding:8px;border-radius:8px}@media screen and (max-width:600px){menu.navMenu_menu__fqlFF span{display:none}div.navMenu_settingsMenuOptions__KWnLv{right:4px}div.navMenu_titleBar__HJoio{padding:8px}}div.chatHistory_chatHistory__CoaVT{display:flex;flex-direction:column;height:100%;margin:auto}div.chatHistory_agentIndicator__wOU1f a{display:flex;text-align:center;align-content:center;align-items:center}div.chatHistory_trainOfThought__mMWSR{border:1px solid var(--border-color);border-radius:16px;padding:8px 16px;margin:12px}div.chatMessage_chatMessageContainer__sAivf{display:flex;flex-direction:column;margin:12px;border-radius:16px;padding:8px 16px 0;word-break:break-word}div.chatMessage_chatMessageWrapper__u5m8A{padding-left:1rem;padding-bottom:1rem;max-width:80vw}div.chatMessage_chatMessageWrapper__u5m8A ol,div.chatMessage_chatMessageWrapper__u5m8A p:not(:last-child),div.chatMessage_chatMessageWrapper__u5m8A ul{margin-bottom:16px}div.chatMessage_chatMessageWrapper__u5m8A a span{display:revert!important}div.chatMessage_khojfullHistory__NPu2l{border-width:1px;padding-left:4px}div.chatMessage_youfullHistory__ioyfH{max-width:100%}div.chatMessage_chatMessageContainer__sAivf.chatMessage_youfullHistory__ioyfH{padding-left:0}div.chatMessage_you__6GUC4{background-color:hsla(var(--secondary));align-self:flex-end;border-radius:16px}div.chatMessage_khoj__cjWON{background-color:transparent;color:hsl(var(--accent-foreground));align-self:flex-start}div.chatMessage_khojChatMessage__BabQz{padding-top:8px;padding-left:16px}div.chatMessage_emptyChatMessage__J9JRn{display:none}div.chatMessage_imagesContainer__HTRjT{display:flex;overflow-x:auto;padding-bottom:8px;margin-bottom:8px}div.chatMessage_imageWrapper__DF92M{flex:0 0 auto;margin-right:8px}div.chatMessage_imageWrapper__DF92M img{width:auto;height:128px;-o-object-fit:cover;object-fit:cover;border-radius:8px}div.chatMessage_chatMessageContainer__sAivf>img{width:auto;height:auto;max-width:100%;max-height:80vh;-o-object-fit:contain;object-fit:contain;display:block;margin-top:.25rem;margin-right:auto}div.chatMessage_chatMessageContainer__sAivf h3 img{width:24px}div.chatMessage_you__6GUC4{color:hsla(var(--secondary-foreground))}div.chatMessage_author__muRtC{font-size:.75rem;color:grey;text-align:right}div.chatMessage_chatFooter__0vR8s{display:flex;justify-content:space-between;min-height:28px}div.chatMessage_chatButtons__Lbk8T{display:flex;justify-content:flex-end;width:-moz-min-content;width:min-content;border:1px solid var(--border-color);border-radius:16px;position:relative;bottom:-12px;background-color:hsla(var(--secondary))}div.chatMessage_chatFooter__0vR8s button{cursor:pointer;color:hsl(var(--muted-foreground));border:none;border-radius:16px;padding:4px;margin-left:4px;margin-right:4px}div.chatMessage_chatFooter__0vR8s button:hover{background-color:hsla(var(--frosted-background-color))}button.chatMessage_codeCopyButton__Y_Ujv{cursor:pointer;float:right;border-radius:8px}button.chatMessage_codeCopyButton__Y_Ujv:hover{color:hsla(var(--frosted-background-color))}button.chatMessage_codeCopyButton__Y_Ujv img,button.chatMessage_copyButton__jd7q7 img,div.chatMessage_feedbackButtons___Brdy img{width:24px}div.chatMessage_trainOfThought__mR2Gg strong{font-weight:500}div.chatMessage_trainOfThought__mR2Gg.chatMessage_primary__WYPEb strong{font-weight:500;color:hsla(var(--secondary-foreground))}div.chatMessage_trainOfThought__mR2Gg.chatMessage_primary__WYPEb p{color:inherit}div.chatMessage_trainOfThoughtElement__le_bC{display:grid;grid-template-columns:auto 1fr;align-items:start}div.chatMessage_trainOfThoughtElement__le_bC ol,div.chatMessage_trainOfThoughtElement__le_bC ul{margin:auto;word-break:break-word}@media screen and (max-width:768px){div.chatMessage_youfullHistory__ioyfH{max-width:90%}}div.chatInputArea_actualInputArea__Ha6cN{display:grid;grid-template-columns:auto 1fr auto auto}.agentCard_agentPersonality__MmRlN p{white-space:inherit;overflow:hidden;height:77px;line-height:1.5}div.agentCard_agentPersonality__MmRlN{text-align:left;grid-column:span 3;overflow:hidden}button.agentCard_infoButton__heh_w{border:none;background-color:transparent!important;text-align:left;font-family:inherit;font-size:medium}div.search_searchLayout__fP3m0{display:grid;grid-template-columns:1fr;gap:1rem;height:100vh}div.search_sidePanel__myfc9{position:fixed;height:100%;z-index:1}@media screen and (max-width:768px){div.search_searchLayout__fP3m0{gap:0}div.search_sidePanel__myfc9{position:relative;height:100%}}
@@ -1 +0,0 @@
1
- div.agents_titleBar__FzYbY{padding:16px 0;text-align:left}.agents_agentPersonality__o0Ysz p{white-space:inherit;overflow:hidden;height:77px;line-height:1.5}div.agents_agentPersonality__o0Ysz{text-align:left;grid-column:span 3;overflow:hidden}div.agents_pageLayout__gR3S3{max-width:60vw;margin:auto auto 2rem}div.agents_sidePanel__wGVGc{position:fixed;height:100%;z-index:1}button.agents_infoButton__NqI7E{border:none;background-color:transparent!important;text-align:left;font-family:inherit;font-size:medium}div.agents_agentList__XVx4A{display:grid;gap:20px;padding-top:30px;margin-right:auto;grid-auto-flow:row;grid-template-columns:1fr 1fr;margin-left:auto}@media only screen and (max-width:768px){div.agents_agentList__XVx4A{width:100%;padding:0;margin-right:auto;margin-left:auto;grid-template-columns:1fr}div.agents_pageLayout__gR3S3{max-width:90vw}div.agents_sidePanel__wGVGc{position:relative;height:100%}}