khoj 1.30.11.dev15__py3-none-any.whl → 1.30.11.dev46__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- khoj/database/admin.py +3 -10
- khoj/database/migrations/0075_migrate_generated_assets_and_validate.py +85 -0
- khoj/database/models/__init__.py +164 -31
- khoj/interface/compiled/404/index.html +1 -1
- khoj/interface/compiled/_next/static/chunks/1603-f5babe72ba9f6a59.js +1 -0
- khoj/interface/compiled/_next/static/chunks/5538-0ea2d3944ca051e1.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/agents/{page-2ffa7560aebff9a1.js → page-f5c0801b27a8e95e.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/automations/{page-b0a6a6ed2267c1a2.js → page-8691f6c09a0acd44.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/chat/{page-02f8616bba3e449e.js → page-135d56dd4263e40d.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/{page-3ffd8f0934b896f3.js → page-e79ace822d51557b.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/search/layout-cae84c87073877f0.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/search/{page-059f237514f77628.js → page-e8b578d155550386.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/settings/{page-32e9423bede5b4a1.js → page-b6c835050c970be7.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-6f4879fbbf8b90f7.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/share/chat/{page-0b8d90dc57dbc1d8.js → page-635635e4fb39fe29.js} +1 -1
- khoj/interface/compiled/_next/static/chunks/{webpack-062298330010d2aa.js → webpack-5203c3872078c10c.js} +1 -1
- khoj/interface/compiled/_next/static/css/592ca99f5122e75a.css +1 -0
- khoj/interface/compiled/_next/static/css/edd3abaf11580924.css +1 -0
- khoj/interface/compiled/agents/index.html +1 -1
- khoj/interface/compiled/agents/index.txt +2 -2
- khoj/interface/compiled/assets/icons/khoj_lantern.svg +100 -0
- khoj/interface/compiled/automations/index.html +1 -1
- khoj/interface/compiled/automations/index.txt +2 -2
- khoj/interface/compiled/chat/index.html +1 -1
- khoj/interface/compiled/chat/index.txt +2 -2
- khoj/interface/compiled/index.html +1 -1
- khoj/interface/compiled/index.txt +2 -2
- khoj/interface/compiled/search/index.html +1 -1
- khoj/interface/compiled/search/index.txt +2 -2
- khoj/interface/compiled/settings/index.html +1 -1
- khoj/interface/compiled/settings/index.txt +2 -2
- khoj/interface/compiled/share/chat/index.html +1 -1
- khoj/interface/compiled/share/chat/index.txt +2 -2
- khoj/processor/conversation/anthropic/anthropic_chat.py +11 -3
- khoj/processor/conversation/google/gemini_chat.py +11 -3
- khoj/processor/conversation/offline/chat_model.py +6 -2
- khoj/processor/conversation/openai/gpt.py +10 -2
- khoj/processor/conversation/prompts.py +18 -0
- khoj/processor/conversation/utils.py +82 -26
- khoj/processor/image/generate.py +10 -13
- khoj/routers/api_chat.py +49 -98
- khoj/routers/helpers.py +41 -1
- {khoj-1.30.11.dev15.dist-info → khoj-1.30.11.dev46.dist-info}/METADATA +1 -1
- {khoj-1.30.11.dev15.dist-info → khoj-1.30.11.dev46.dist-info}/RECORD +49 -47
- khoj/interface/compiled/_next/static/chunks/1603-c68d44bc4ae6039a.js +0 -1
- khoj/interface/compiled/_next/static/chunks/5538-e5f3c9f4d67a64b9.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/search/layout-2ca475462c0b2176.js +0 -1
- khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-592e8c470f2c2084.js +0 -1
- khoj/interface/compiled/_next/static/css/80bd6301fc657983.css +0 -1
- khoj/interface/compiled/_next/static/css/9d45de78fba367c1.css +0 -1
- /khoj/interface/compiled/_next/static/{HwvgU9Hbpk8cDtZdz8u6Z → VhbBwTudxbu82AwZhVKwF}/_buildManifest.js +0 -0
- /khoj/interface/compiled/_next/static/{HwvgU9Hbpk8cDtZdz8u6Z → VhbBwTudxbu82AwZhVKwF}/_ssgManifest.js +0 -0
- {khoj-1.30.11.dev15.dist-info → khoj-1.30.11.dev46.dist-info}/WHEEL +0 -0
- {khoj-1.30.11.dev15.dist-info → khoj-1.30.11.dev46.dist-info}/entry_points.txt +0 -0
- {khoj-1.30.11.dev15.dist-info → khoj-1.30.11.dev46.dist-info}/licenses/LICENSE +0 -0
khoj/database/admin.py
CHANGED
@@ -303,17 +303,10 @@ class ConversationAdmin(unfold_admin.ModelAdmin):
|
|
303
303
|
modified_log = conversation.conversation_log
|
304
304
|
chat_log = modified_log.get("chat", [])
|
305
305
|
for idx, log in enumerate(chat_log):
|
306
|
-
if
|
307
|
-
log["
|
308
|
-
and log["intent"]
|
309
|
-
and log["intent"]["type"]
|
310
|
-
and (
|
311
|
-
log["intent"]["type"] == ImageIntentType.TEXT_TO_IMAGE.value
|
312
|
-
or log["intent"]["type"] == ImageIntentType.TEXT_TO_IMAGE_V3.value
|
313
|
-
)
|
314
|
-
):
|
315
|
-
log["message"] = "inline image redacted for space"
|
306
|
+
if log["by"] == "khoj" and log["images"]:
|
307
|
+
log["images"] = ["inline image redacted for space"]
|
316
308
|
chat_log[idx] = log
|
309
|
+
|
317
310
|
modified_log["chat"] = chat_log
|
318
311
|
|
319
312
|
writer.writerow(
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# Made manually by sabaimran for use by Django 5.0.9 on 2024-12-01 16:59
|
2
|
+
|
3
|
+
from django.db import migrations, models
|
4
|
+
|
5
|
+
# This script was written alongside when Pydantic validation was added to the Conversation conversation_log field.
|
6
|
+
|
7
|
+
|
8
|
+
def migrate_generated_assets(apps, schema_editor):
|
9
|
+
Conversation = apps.get_model("database", "Conversation")
|
10
|
+
|
11
|
+
# Process conversations in chunks
|
12
|
+
for conversation in Conversation.objects.iterator():
|
13
|
+
try:
|
14
|
+
meta_log = conversation.conversation_log
|
15
|
+
modified = False
|
16
|
+
|
17
|
+
for chat in meta_log.get("chat", []):
|
18
|
+
intent_type = chat.get("intent", {}).get("type")
|
19
|
+
|
20
|
+
if intent_type and chat["by"] == "khoj":
|
21
|
+
if intent_type and "text-to-image" in intent_type:
|
22
|
+
# Migrate the generated image to the new format
|
23
|
+
chat["images"] = [chat.get("message")]
|
24
|
+
chat["message"] = chat["intent"]["inferred-queries"][0]
|
25
|
+
modified = True
|
26
|
+
|
27
|
+
if intent_type and "excalidraw" in intent_type:
|
28
|
+
# Migrate the generated excalidraw to the new format
|
29
|
+
chat["excalidrawDiagram"] = chat.get("message")
|
30
|
+
chat["message"] = chat["intent"]["inferred-queries"][0]
|
31
|
+
modified = True
|
32
|
+
|
33
|
+
# Only save if changes were made
|
34
|
+
if modified:
|
35
|
+
conversation.conversation_log = meta_log
|
36
|
+
conversation.save()
|
37
|
+
|
38
|
+
except Exception as e:
|
39
|
+
print(f"Error processing conversation {conversation.id}: {str(e)}")
|
40
|
+
continue
|
41
|
+
|
42
|
+
|
43
|
+
def reverse_migration(apps, schema_editor):
|
44
|
+
Conversation = apps.get_model("database", "Conversation")
|
45
|
+
|
46
|
+
# Process conversations in chunks
|
47
|
+
for conversation in Conversation.objects.iterator():
|
48
|
+
try:
|
49
|
+
meta_log = conversation.conversation_log
|
50
|
+
modified = False
|
51
|
+
|
52
|
+
for chat in meta_log.get("chat", []):
|
53
|
+
intent_type = chat.get("intent", {}).get("type")
|
54
|
+
|
55
|
+
if intent_type and chat["by"] == "khoj":
|
56
|
+
if intent_type and "text-to-image" in intent_type:
|
57
|
+
# Migrate the generated image back to the old format
|
58
|
+
chat["message"] = chat.get("images", [])[0]
|
59
|
+
chat.pop("images", None)
|
60
|
+
modified = True
|
61
|
+
|
62
|
+
if intent_type and "excalidraw" in intent_type:
|
63
|
+
# Migrate the generated excalidraw back to the old format
|
64
|
+
chat["message"] = chat.get("excalidrawDiagram")
|
65
|
+
chat.pop("excalidrawDiagram", None)
|
66
|
+
modified = True
|
67
|
+
|
68
|
+
# Only save if changes were made
|
69
|
+
if modified:
|
70
|
+
conversation.conversation_log = meta_log
|
71
|
+
conversation.save()
|
72
|
+
|
73
|
+
except Exception as e:
|
74
|
+
print(f"Error processing conversation {conversation.id}: {str(e)}")
|
75
|
+
continue
|
76
|
+
|
77
|
+
|
78
|
+
class Migration(migrations.Migration):
|
79
|
+
dependencies = [
|
80
|
+
("database", "0074_alter_conversation_title"),
|
81
|
+
]
|
82
|
+
|
83
|
+
operations = [
|
84
|
+
migrations.RunPython(migrate_generated_assets, reverse_migration),
|
85
|
+
]
|
khoj/database/models/__init__.py
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
import logging
|
1
2
|
import os
|
2
3
|
import re
|
3
4
|
import uuid
|
4
5
|
from random import choice
|
6
|
+
from typing import Dict, List, Optional, Union
|
5
7
|
|
6
8
|
from django.contrib.auth.models import AbstractUser
|
7
9
|
from django.contrib.postgres.fields import ArrayField
|
@@ -11,9 +13,109 @@ from django.db.models.signals import pre_save
|
|
11
13
|
from django.dispatch import receiver
|
12
14
|
from pgvector.django import VectorField
|
13
15
|
from phonenumber_field.modelfields import PhoneNumberField
|
16
|
+
from pydantic import BaseModel as PydanticBaseModel
|
17
|
+
from pydantic import Field
|
14
18
|
|
19
|
+
logger = logging.getLogger(__name__)
|
15
20
|
|
16
|
-
|
21
|
+
|
22
|
+
# Pydantic models for type Chat Message validation
|
23
|
+
class Context(PydanticBaseModel):
|
24
|
+
compiled: str
|
25
|
+
file: str
|
26
|
+
|
27
|
+
|
28
|
+
class CodeContextFile(PydanticBaseModel):
|
29
|
+
filename: str
|
30
|
+
b64_data: str
|
31
|
+
|
32
|
+
|
33
|
+
class CodeContextResult(PydanticBaseModel):
|
34
|
+
success: bool
|
35
|
+
output_files: List[CodeContextFile]
|
36
|
+
std_out: str
|
37
|
+
std_err: str
|
38
|
+
code_runtime: int
|
39
|
+
|
40
|
+
|
41
|
+
class CodeContextData(PydanticBaseModel):
|
42
|
+
code: str
|
43
|
+
result: Optional[CodeContextResult] = None
|
44
|
+
|
45
|
+
|
46
|
+
class WebPage(PydanticBaseModel):
|
47
|
+
link: str
|
48
|
+
query: Optional[str] = None
|
49
|
+
snippet: str
|
50
|
+
|
51
|
+
|
52
|
+
class AnswerBox(PydanticBaseModel):
|
53
|
+
link: Optional[str] = None
|
54
|
+
snippet: Optional[str] = None
|
55
|
+
title: str
|
56
|
+
snippetHighlighted: Optional[List[str]] = None
|
57
|
+
|
58
|
+
|
59
|
+
class PeopleAlsoAsk(PydanticBaseModel):
|
60
|
+
link: Optional[str] = None
|
61
|
+
question: Optional[str] = None
|
62
|
+
snippet: Optional[str] = None
|
63
|
+
title: str
|
64
|
+
|
65
|
+
|
66
|
+
class KnowledgeGraph(PydanticBaseModel):
|
67
|
+
attributes: Optional[Dict[str, str]] = None
|
68
|
+
description: Optional[str] = None
|
69
|
+
descriptionLink: Optional[str] = None
|
70
|
+
descriptionSource: Optional[str] = None
|
71
|
+
imageUrl: Optional[str] = None
|
72
|
+
title: str
|
73
|
+
type: Optional[str] = None
|
74
|
+
|
75
|
+
|
76
|
+
class OrganicContext(PydanticBaseModel):
|
77
|
+
snippet: str
|
78
|
+
title: str
|
79
|
+
link: str
|
80
|
+
|
81
|
+
|
82
|
+
class OnlineContext(PydanticBaseModel):
|
83
|
+
webpages: Optional[Union[WebPage, List[WebPage]]] = None
|
84
|
+
answerBox: Optional[AnswerBox] = None
|
85
|
+
peopleAlsoAsk: Optional[List[PeopleAlsoAsk]] = None
|
86
|
+
knowledgeGraph: Optional[KnowledgeGraph] = None
|
87
|
+
organicContext: Optional[List[OrganicContext]] = None
|
88
|
+
|
89
|
+
|
90
|
+
class Intent(PydanticBaseModel):
|
91
|
+
type: str
|
92
|
+
query: str
|
93
|
+
memory_type: str = Field(alias="memory-type")
|
94
|
+
inferred_queries: Optional[List[str]] = Field(default=None, alias="inferred-queries")
|
95
|
+
|
96
|
+
|
97
|
+
class TrainOfThought(PydanticBaseModel):
|
98
|
+
type: str
|
99
|
+
data: str
|
100
|
+
|
101
|
+
|
102
|
+
class ChatMessage(PydanticBaseModel):
|
103
|
+
message: str
|
104
|
+
trainOfThought: List[TrainOfThought] = []
|
105
|
+
context: List[Context] = []
|
106
|
+
onlineContext: Dict[str, OnlineContext] = {}
|
107
|
+
codeContext: Dict[str, CodeContextData] = {}
|
108
|
+
created: str
|
109
|
+
images: Optional[List[str]] = None
|
110
|
+
queryFiles: Optional[List[Dict]] = None
|
111
|
+
excalidrawDiagram: Optional[List[Dict]] = None
|
112
|
+
by: str
|
113
|
+
turnId: Optional[str] = None
|
114
|
+
intent: Optional[Intent] = None
|
115
|
+
automationId: Optional[str] = None
|
116
|
+
|
117
|
+
|
118
|
+
class DbBaseModel(models.Model):
|
17
119
|
created_at = models.DateTimeField(auto_now_add=True)
|
18
120
|
updated_at = models.DateTimeField(auto_now=True)
|
19
121
|
|
@@ -21,7 +123,7 @@ class BaseModel(models.Model):
|
|
21
123
|
abstract = True
|
22
124
|
|
23
125
|
|
24
|
-
class ClientApplication(
|
126
|
+
class ClientApplication(DbBaseModel):
|
25
127
|
name = models.CharField(max_length=200)
|
26
128
|
client_id = models.CharField(max_length=200)
|
27
129
|
client_secret = models.CharField(max_length=200)
|
@@ -67,7 +169,7 @@ class KhojApiUser(models.Model):
|
|
67
169
|
accessed_at = models.DateTimeField(null=True, default=None)
|
68
170
|
|
69
171
|
|
70
|
-
class Subscription(
|
172
|
+
class Subscription(DbBaseModel):
|
71
173
|
class Type(models.TextChoices):
|
72
174
|
TRIAL = "trial"
|
73
175
|
STANDARD = "standard"
|
@@ -79,13 +181,13 @@ class Subscription(BaseModel):
|
|
79
181
|
enabled_trial_at = models.DateTimeField(null=True, default=None, blank=True)
|
80
182
|
|
81
183
|
|
82
|
-
class OpenAIProcessorConversationConfig(
|
184
|
+
class OpenAIProcessorConversationConfig(DbBaseModel):
|
83
185
|
name = models.CharField(max_length=200)
|
84
186
|
api_key = models.CharField(max_length=200)
|
85
187
|
api_base_url = models.URLField(max_length=200, default=None, blank=True, null=True)
|
86
188
|
|
87
189
|
|
88
|
-
class ChatModelOptions(
|
190
|
+
class ChatModelOptions(DbBaseModel):
|
89
191
|
class ModelType(models.TextChoices):
|
90
192
|
OPENAI = "openai"
|
91
193
|
OFFLINE = "offline"
|
@@ -103,12 +205,12 @@ class ChatModelOptions(BaseModel):
|
|
103
205
|
)
|
104
206
|
|
105
207
|
|
106
|
-
class VoiceModelOption(
|
208
|
+
class VoiceModelOption(DbBaseModel):
|
107
209
|
model_id = models.CharField(max_length=200)
|
108
210
|
name = models.CharField(max_length=200)
|
109
211
|
|
110
212
|
|
111
|
-
class Agent(
|
213
|
+
class Agent(DbBaseModel):
|
112
214
|
class StyleColorTypes(models.TextChoices):
|
113
215
|
BLUE = "blue"
|
114
216
|
GREEN = "green"
|
@@ -208,7 +310,7 @@ class Agent(BaseModel):
|
|
208
310
|
super().save(*args, **kwargs)
|
209
311
|
|
210
312
|
|
211
|
-
class ProcessLock(
|
313
|
+
class ProcessLock(DbBaseModel):
|
212
314
|
class Operation(models.TextChoices):
|
213
315
|
INDEX_CONTENT = "index_content"
|
214
316
|
SCHEDULED_JOB = "scheduled_job"
|
@@ -231,24 +333,24 @@ def verify_agent(sender, instance, **kwargs):
|
|
231
333
|
raise ValidationError(f"A private Agent with the name {instance.name} already exists.")
|
232
334
|
|
233
335
|
|
234
|
-
class NotionConfig(
|
336
|
+
class NotionConfig(DbBaseModel):
|
235
337
|
token = models.CharField(max_length=200)
|
236
338
|
user = models.ForeignKey(KhojUser, on_delete=models.CASCADE)
|
237
339
|
|
238
340
|
|
239
|
-
class GithubConfig(
|
341
|
+
class GithubConfig(DbBaseModel):
|
240
342
|
pat_token = models.CharField(max_length=200)
|
241
343
|
user = models.ForeignKey(KhojUser, on_delete=models.CASCADE)
|
242
344
|
|
243
345
|
|
244
|
-
class GithubRepoConfig(
|
346
|
+
class GithubRepoConfig(DbBaseModel):
|
245
347
|
name = models.CharField(max_length=200)
|
246
348
|
owner = models.CharField(max_length=200)
|
247
349
|
branch = models.CharField(max_length=200)
|
248
350
|
github_config = models.ForeignKey(GithubConfig, on_delete=models.CASCADE, related_name="githubrepoconfig")
|
249
351
|
|
250
352
|
|
251
|
-
class WebScraper(
|
353
|
+
class WebScraper(DbBaseModel):
|
252
354
|
class WebScraperType(models.TextChoices):
|
253
355
|
FIRECRAWL = "Firecrawl"
|
254
356
|
OLOSTEP = "Olostep"
|
@@ -321,7 +423,7 @@ class WebScraper(BaseModel):
|
|
321
423
|
super().save(*args, **kwargs)
|
322
424
|
|
323
425
|
|
324
|
-
class ServerChatSettings(
|
426
|
+
class ServerChatSettings(DbBaseModel):
|
325
427
|
chat_default = models.ForeignKey(
|
326
428
|
ChatModelOptions, on_delete=models.CASCADE, default=None, null=True, blank=True, related_name="chat_default"
|
327
429
|
)
|
@@ -333,35 +435,35 @@ class ServerChatSettings(BaseModel):
|
|
333
435
|
)
|
334
436
|
|
335
437
|
|
336
|
-
class LocalOrgConfig(
|
438
|
+
class LocalOrgConfig(DbBaseModel):
|
337
439
|
input_files = models.JSONField(default=list, null=True)
|
338
440
|
input_filter = models.JSONField(default=list, null=True)
|
339
441
|
index_heading_entries = models.BooleanField(default=False)
|
340
442
|
user = models.ForeignKey(KhojUser, on_delete=models.CASCADE)
|
341
443
|
|
342
444
|
|
343
|
-
class LocalMarkdownConfig(
|
445
|
+
class LocalMarkdownConfig(DbBaseModel):
|
344
446
|
input_files = models.JSONField(default=list, null=True)
|
345
447
|
input_filter = models.JSONField(default=list, null=True)
|
346
448
|
index_heading_entries = models.BooleanField(default=False)
|
347
449
|
user = models.ForeignKey(KhojUser, on_delete=models.CASCADE)
|
348
450
|
|
349
451
|
|
350
|
-
class LocalPdfConfig(
|
452
|
+
class LocalPdfConfig(DbBaseModel):
|
351
453
|
input_files = models.JSONField(default=list, null=True)
|
352
454
|
input_filter = models.JSONField(default=list, null=True)
|
353
455
|
index_heading_entries = models.BooleanField(default=False)
|
354
456
|
user = models.ForeignKey(KhojUser, on_delete=models.CASCADE)
|
355
457
|
|
356
458
|
|
357
|
-
class LocalPlaintextConfig(
|
459
|
+
class LocalPlaintextConfig(DbBaseModel):
|
358
460
|
input_files = models.JSONField(default=list, null=True)
|
359
461
|
input_filter = models.JSONField(default=list, null=True)
|
360
462
|
index_heading_entries = models.BooleanField(default=False)
|
361
463
|
user = models.ForeignKey(KhojUser, on_delete=models.CASCADE)
|
362
464
|
|
363
465
|
|
364
|
-
class SearchModelConfig(
|
466
|
+
class SearchModelConfig(DbBaseModel):
|
365
467
|
class ModelType(models.TextChoices):
|
366
468
|
TEXT = "text"
|
367
469
|
|
@@ -393,7 +495,7 @@ class SearchModelConfig(BaseModel):
|
|
393
495
|
bi_encoder_confidence_threshold = models.FloatField(default=0.18)
|
394
496
|
|
395
497
|
|
396
|
-
class TextToImageModelConfig(
|
498
|
+
class TextToImageModelConfig(DbBaseModel):
|
397
499
|
class ModelType(models.TextChoices):
|
398
500
|
OPENAI = "openai"
|
399
501
|
STABILITYAI = "stability-ai"
|
@@ -430,7 +532,7 @@ class TextToImageModelConfig(BaseModel):
|
|
430
532
|
super().save(*args, **kwargs)
|
431
533
|
|
432
534
|
|
433
|
-
class SpeechToTextModelOptions(
|
535
|
+
class SpeechToTextModelOptions(DbBaseModel):
|
434
536
|
class ModelType(models.TextChoices):
|
435
537
|
OPENAI = "openai"
|
436
538
|
OFFLINE = "offline"
|
@@ -439,22 +541,22 @@ class SpeechToTextModelOptions(BaseModel):
|
|
439
541
|
model_type = models.CharField(max_length=200, choices=ModelType.choices, default=ModelType.OFFLINE)
|
440
542
|
|
441
543
|
|
442
|
-
class UserConversationConfig(
|
544
|
+
class UserConversationConfig(DbBaseModel):
|
443
545
|
user = models.OneToOneField(KhojUser, on_delete=models.CASCADE)
|
444
546
|
setting = models.ForeignKey(ChatModelOptions, on_delete=models.CASCADE, default=None, null=True, blank=True)
|
445
547
|
|
446
548
|
|
447
|
-
class UserVoiceModelConfig(
|
549
|
+
class UserVoiceModelConfig(DbBaseModel):
|
448
550
|
user = models.OneToOneField(KhojUser, on_delete=models.CASCADE)
|
449
551
|
setting = models.ForeignKey(VoiceModelOption, on_delete=models.CASCADE, default=None, null=True, blank=True)
|
450
552
|
|
451
553
|
|
452
|
-
class UserTextToImageModelConfig(
|
554
|
+
class UserTextToImageModelConfig(DbBaseModel):
|
453
555
|
user = models.OneToOneField(KhojUser, on_delete=models.CASCADE)
|
454
556
|
setting = models.ForeignKey(TextToImageModelConfig, on_delete=models.CASCADE)
|
455
557
|
|
456
558
|
|
457
|
-
class Conversation(
|
559
|
+
class Conversation(DbBaseModel):
|
458
560
|
user = models.ForeignKey(KhojUser, on_delete=models.CASCADE)
|
459
561
|
conversation_log = models.JSONField(default=dict)
|
460
562
|
client = models.ForeignKey(ClientApplication, on_delete=models.CASCADE, default=None, null=True, blank=True)
|
@@ -468,8 +570,39 @@ class Conversation(BaseModel):
|
|
468
570
|
file_filters = models.JSONField(default=list)
|
469
571
|
id = models.UUIDField(default=uuid.uuid4, editable=False, unique=True, primary_key=True, db_index=True)
|
470
572
|
|
573
|
+
def clean(self):
|
574
|
+
# Validate conversation_log structure
|
575
|
+
try:
|
576
|
+
messages = self.conversation_log.get("chat", [])
|
577
|
+
for msg in messages:
|
578
|
+
ChatMessage.model_validate(msg)
|
579
|
+
except Exception as e:
|
580
|
+
raise ValidationError(f"Invalid conversation_log format: {str(e)}")
|
581
|
+
|
582
|
+
def save(self, *args, **kwargs):
|
583
|
+
self.clean()
|
584
|
+
super().save(*args, **kwargs)
|
471
585
|
|
472
|
-
|
586
|
+
@property
|
587
|
+
def messages(self) -> List[ChatMessage]:
|
588
|
+
"""Type-hinted accessor for conversation messages"""
|
589
|
+
validated_messages = []
|
590
|
+
for msg in self.conversation_log.get("chat", []):
|
591
|
+
try:
|
592
|
+
# Clean up inferred queries if they contain None
|
593
|
+
if msg.get("intent") and msg["intent"].get("inferred-queries"):
|
594
|
+
msg["intent"]["inferred-queries"] = [
|
595
|
+
q for q in msg["intent"]["inferred-queries"] if q is not None and isinstance(q, str)
|
596
|
+
]
|
597
|
+
msg["message"] = str(msg.get("message", ""))
|
598
|
+
validated_messages.append(ChatMessage.model_validate(msg))
|
599
|
+
except ValidationError as e:
|
600
|
+
logger.warning(f"Skipping invalid message in conversation: {e}")
|
601
|
+
continue
|
602
|
+
return validated_messages
|
603
|
+
|
604
|
+
|
605
|
+
class PublicConversation(DbBaseModel):
|
473
606
|
source_owner = models.ForeignKey(KhojUser, on_delete=models.CASCADE)
|
474
607
|
conversation_log = models.JSONField(default=dict)
|
475
608
|
slug = models.CharField(max_length=200, default=None, null=True, blank=True)
|
@@ -499,12 +632,12 @@ def verify_public_conversation(sender, instance, **kwargs):
|
|
499
632
|
instance.slug = slug
|
500
633
|
|
501
634
|
|
502
|
-
class ReflectiveQuestion(
|
635
|
+
class ReflectiveQuestion(DbBaseModel):
|
503
636
|
question = models.CharField(max_length=500)
|
504
637
|
user = models.ForeignKey(KhojUser, on_delete=models.CASCADE, default=None, null=True, blank=True)
|
505
638
|
|
506
639
|
|
507
|
-
class Entry(
|
640
|
+
class Entry(DbBaseModel):
|
508
641
|
class EntryType(models.TextChoices):
|
509
642
|
IMAGE = "image"
|
510
643
|
PDF = "pdf"
|
@@ -541,7 +674,7 @@ class Entry(BaseModel):
|
|
541
674
|
raise ValidationError("An Entry cannot be associated with both a user and an agent.")
|
542
675
|
|
543
676
|
|
544
|
-
class FileObject(
|
677
|
+
class FileObject(DbBaseModel):
|
545
678
|
# Same as Entry but raw will be a much larger string
|
546
679
|
file_name = models.CharField(max_length=400, default=None, null=True, blank=True)
|
547
680
|
raw_text = models.TextField()
|
@@ -549,7 +682,7 @@ class FileObject(BaseModel):
|
|
549
682
|
agent = models.ForeignKey(Agent, on_delete=models.CASCADE, default=None, null=True, blank=True)
|
550
683
|
|
551
684
|
|
552
|
-
class EntryDates(
|
685
|
+
class EntryDates(DbBaseModel):
|
553
686
|
date = models.DateField()
|
554
687
|
entry = models.ForeignKey(Entry, on_delete=models.CASCADE, related_name="embeddings_dates")
|
555
688
|
|
@@ -559,12 +692,12 @@ class EntryDates(BaseModel):
|
|
559
692
|
]
|
560
693
|
|
561
694
|
|
562
|
-
class UserRequests(
|
695
|
+
class UserRequests(DbBaseModel):
|
563
696
|
user = models.ForeignKey(KhojUser, on_delete=models.CASCADE)
|
564
697
|
slug = models.CharField(max_length=200)
|
565
698
|
|
566
699
|
|
567
|
-
class DataStore(
|
700
|
+
class DataStore(DbBaseModel):
|
568
701
|
key = models.CharField(max_length=200, unique=True)
|
569
702
|
value = models.JSONField(default=dict)
|
570
703
|
private = models.BooleanField(default=False)
|
@@ -1 +1 @@
|
|
1
|
-
<!DOCTYPE html><html lang="en" class="__variable_f36179 __variable_702545"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/1d8a05b60287ae6c-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/77c207b095007c34-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/82ef96de0e8f4d8c-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/a6ecd16fa044d500-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/c4250770ab8708b6-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/e098aaaecc9cfbb2-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/089de1d8526b96e9.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/3c34171b174cc381.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-062298330010d2aa.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><meta name="robots" content="noindex"/><meta http-equiv="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';"/><title>404: This page could not be found.</title><title>Khoj AI - Home</title><meta name="description" content="Your Second Brain."/><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><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>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)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/_next/static/chunks/webpack-062298330010d2aa.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/1d8a05b60287ae6c-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/media/77c207b095007c34-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n3:HL[\"/_next/static/media/82ef96de0e8f4d8c-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n4:HL[\"/_next/static/media/a6ecd16fa044d500-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n5:HL[\"/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n6:HL[\"/_next/static/media/c4250770ab8708b6-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n7:HL[\"/_next/static/media/e098aaaecc9cfbb2-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n8:HL[\"/_next/static/css/089de1d8526b96e9.css\",\"style\"]\n9:HL[\"/_next/static/css/3c34171b174cc381.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"a:I[95751,[],\"\"]\nc:I[39275,[],\"\"]\nd:I[61343,[],\"\"]\n13:I[76130,[],\"\"]\ne:{\"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\"}\nf:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n10:{\"display\":\"inline-block\"}\n11:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\n14:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$La\",null,{\"buildId\":\"HwvgU9Hbpk8cDtZdz8u6Z\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"_not-found\",\"\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$Lb\",[[\"$\",\"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.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$Lc\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Ld\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/089de1d8526b96e9.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/3c34171b174cc381.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"__variable_f36179 __variable_702545\",\"children\":[[\"$\",\"meta\",null,{\"httpEquiv\":\"Content-Security-Policy\",\"content\":\"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev '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,{\"children\":[\"$\",\"$Lc\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Ld\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$e\",\"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\":\"$f\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$10\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$11\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$L12\"],\"globalErrorComponent\":\"$13\",\"missingSlots\":\"$W14\"}]\n"])</script><script>self.__next_f.push([1,"12:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Khoj AI - Home\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Your Second Brain.\"}],[\"$\",\"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,"b:null\n"])</script></body></html>
|
1
|
+
<!DOCTYPE html><html lang="en" class="__variable_f36179 __variable_702545"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/1d8a05b60287ae6c-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/77c207b095007c34-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/82ef96de0e8f4d8c-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/a6ecd16fa044d500-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/c4250770ab8708b6-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/e098aaaecc9cfbb2-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/089de1d8526b96e9.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/3c34171b174cc381.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-5203c3872078c10c.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><meta name="robots" content="noindex"/><meta http-equiv="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';"/><title>404: This page could not be found.</title><title>Khoj AI - Home</title><meta name="description" content="Your Second Brain."/><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><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>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)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/_next/static/chunks/webpack-5203c3872078c10c.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/media/1d8a05b60287ae6c-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/_next/static/media/77c207b095007c34-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n3:HL[\"/_next/static/media/82ef96de0e8f4d8c-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n4:HL[\"/_next/static/media/a6ecd16fa044d500-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n5:HL[\"/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n6:HL[\"/_next/static/media/c4250770ab8708b6-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n7:HL[\"/_next/static/media/e098aaaecc9cfbb2-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n8:HL[\"/_next/static/css/089de1d8526b96e9.css\",\"style\"]\n9:HL[\"/_next/static/css/3c34171b174cc381.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"a:I[95751,[],\"\"]\nc:I[39275,[],\"\"]\nd:I[61343,[],\"\"]\n13:I[76130,[],\"\"]\ne:{\"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\"}\nf:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n10:{\"display\":\"inline-block\"}\n11:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\n14:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$La\",null,{\"buildId\":\"VhbBwTudxbu82AwZhVKwF\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"_not-found\",\"\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$Lb\",[[\"$\",\"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.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$Lc\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Ld\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/089de1d8526b96e9.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/3c34171b174cc381.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"__variable_f36179 __variable_702545\",\"children\":[[\"$\",\"meta\",null,{\"httpEquiv\":\"Content-Security-Policy\",\"content\":\"default-src 'self' https://assets.khoj.dev; media-src * blob:; script-src 'self' https://assets.khoj.dev '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,{\"children\":[\"$\",\"$Lc\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Ld\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$e\",\"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\":\"$f\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$10\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$11\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$L12\"],\"globalErrorComponent\":\"$13\",\"missingSlots\":\"$W14\"}]\n"])</script><script>self.__next_f.push([1,"12:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Khoj AI - Home\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Your Second Brain.\"}],[\"$\",\"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,"b:null\n"])</script></body></html>
|