diff --git a/src/khoj/processor/content/github/github_to_entries.py b/src/khoj/processor/content/github/github_to_entries.py index b0854850..1149227e 100644 --- a/src/khoj/processor/content/github/github_to_entries.py +++ b/src/khoj/processor/content/github/github_to_entries.py @@ -11,7 +11,7 @@ from khoj.database.models import Entry as DbEntry from khoj.database.models import GithubConfig, KhojUser from khoj.processor.content.markdown.markdown_to_entries import MarkdownToEntries from khoj.processor.content.org_mode.org_to_entries import OrgToEntries -from khoj.processor.text_to_entries import TextToEntries +from khoj.processor.content.text_to_entries import TextToEntries # Internal Packages from khoj.utils.helpers import timer diff --git a/src/khoj/processor/content/markdown/markdown_to_entries.py b/src/khoj/processor/content/markdown/markdown_to_entries.py index 05531d70..2a4b6348 100644 --- a/src/khoj/processor/content/markdown/markdown_to_entries.py +++ b/src/khoj/processor/content/markdown/markdown_to_entries.py @@ -10,7 +10,7 @@ from khoj.database.models import Entry as DbEntry from khoj.database.models import KhojUser # Internal Packages -from khoj.processor.text_to_entries import TextToEntries +from khoj.processor.content.text_to_entries import TextToEntries from khoj.utils.constants import empty_escape_sequences from khoj.utils.helpers import timer from khoj.utils.rawconfig import Entry diff --git a/src/khoj/processor/content/notion/notion_to_entries.py b/src/khoj/processor/content/notion/notion_to_entries.py index 4a2fd817..21c7232d 100644 --- a/src/khoj/processor/content/notion/notion_to_entries.py +++ b/src/khoj/processor/content/notion/notion_to_entries.py @@ -8,7 +8,7 @@ import requests from khoj.database.models import Entry as DbEntry from khoj.database.models import KhojUser, NotionConfig -from khoj.processor.text_to_entries import TextToEntries +from khoj.processor.content.text_to_entries import TextToEntries # Internal Packages from khoj.utils.helpers import timer diff --git a/src/khoj/processor/content/org_mode/org_to_entries.py b/src/khoj/processor/content/org_mode/org_to_entries.py index 37c569e9..c3f345f0 100644 --- a/src/khoj/processor/content/org_mode/org_to_entries.py +++ b/src/khoj/processor/content/org_mode/org_to_entries.py @@ -8,7 +8,7 @@ from khoj.database.models import KhojUser # Internal Packages from khoj.processor.content.org_mode import orgnode -from khoj.processor.text_to_entries import TextToEntries +from khoj.processor.content.text_to_entries import TextToEntries from khoj.utils import state from khoj.utils.helpers import timer from khoj.utils.rawconfig import Entry diff --git a/src/khoj/processor/content/pdf/pdf_to_entries.py b/src/khoj/processor/content/pdf/pdf_to_entries.py index f1769a49..caa93636 100644 --- a/src/khoj/processor/content/pdf/pdf_to_entries.py +++ b/src/khoj/processor/content/pdf/pdf_to_entries.py @@ -11,7 +11,7 @@ from khoj.database.models import Entry as DbEntry from khoj.database.models import KhojUser # Internal Packages -from khoj.processor.text_to_entries import TextToEntries +from khoj.processor.content.text_to_entries import TextToEntries from khoj.utils.helpers import timer from khoj.utils.rawconfig import Entry diff --git a/src/khoj/processor/content/plaintext/plaintext_to_entries.py b/src/khoj/processor/content/plaintext/plaintext_to_entries.py index 39966bef..cae88837 100644 --- a/src/khoj/processor/content/plaintext/plaintext_to_entries.py +++ b/src/khoj/processor/content/plaintext/plaintext_to_entries.py @@ -9,7 +9,7 @@ from khoj.database.models import Entry as DbEntry from khoj.database.models import KhojUser # Internal Packages -from khoj.processor.text_to_entries import TextToEntries +from khoj.processor.content.text_to_entries import TextToEntries from khoj.utils.helpers import timer from khoj.utils.rawconfig import Entry diff --git a/src/khoj/processor/text_to_entries.py b/src/khoj/processor/content/text_to_entries.py similarity index 100% rename from src/khoj/processor/text_to_entries.py rename to src/khoj/processor/content/text_to_entries.py diff --git a/src/khoj/processor/conversation/prompts.py b/src/khoj/processor/conversation/prompts.py index cba7cb59..b0e316da 100644 --- a/src/khoj/processor/conversation/prompts.py +++ b/src/khoj/processor/conversation/prompts.py @@ -10,7 +10,7 @@ You are Khoj, a smart, inquisitive and helpful personal assistant. Use your general knowledge and the past conversation with the user as context to inform your responses. You were created by Khoj Inc. with the following capabilities: -- You *CAN REMEMBER ALL NOTES and PERSONAL INFORMATION FOREVER* that the user ever shares with you. They can share files with you using the Khoj desktop application. +- You *CAN REMEMBER ALL NOTES and PERSONAL INFORMATION FOREVER* that the user ever shares with you. They can share files with you using any Khoj client, including the native Desktop app, the Obsidian or Emacs plugins, or the web app. - You cannot set reminders. - Say "I don't know" or "I don't understand" if you don't know what to say or if you don't know the answer to a question. - Ask crisp follow-up questions to get additional context, when the answer cannot be inferred from the provided notes or past conversations. @@ -128,8 +128,9 @@ The user has a question which you can use the internet to respond to. Can you br Today's date in UTC: {current_date} Here are some examples of questions and subqueries: -Q: What is the weather like in New York? -A: ["weather in new york"] + +Q: Posts about vector databases on Hacker News +A: ["site:"news.ycombinator.com vector database"] Q: What is the weather like in New York and San Francisco? A: ["weather in new york", "weather in san francisco"] diff --git a/src/khoj/search_type/text_search.py b/src/khoj/search_type/text_search.py index ca0ac6d3..d04d4c6a 100644 --- a/src/khoj/search_type/text_search.py +++ b/src/khoj/search_type/text_search.py @@ -18,7 +18,7 @@ from khoj.utils.models import BaseEncoder from khoj.utils.state import SearchType from khoj.utils.rawconfig import SearchResponse, Entry from khoj.utils.jsonl import load_jsonl -from khoj.processor.text_to_entries import TextToEntries +from khoj.processor.content.text_to_entries import TextToEntries from khoj.database.adapters import EntryAdapters from khoj.database.models import KhojUser, Entry as DbEntry @@ -141,7 +141,7 @@ def collate_results(hits, dedupe=True): else: hit_ids.add(hit.corpus_id) - yield SearchResponse.parse_obj( + yield SearchResponse.model_validate( { "entry": hit.raw, "score": hit.distance, diff --git a/tests/test_org_to_entries.py b/tests/test_org_to_entries.py index 742c9f8e..6cd5e3ce 100644 --- a/tests/test_org_to_entries.py +++ b/tests/test_org_to_entries.py @@ -4,7 +4,7 @@ import os # Internal Packages from khoj.processor.content.org_mode.org_to_entries import OrgToEntries -from khoj.processor.text_to_entries import TextToEntries +from khoj.processor.content.text_to_entries import TextToEntries from khoj.utils.helpers import is_none_or_empty from khoj.utils.rawconfig import Entry from khoj.utils.fs_syncer import get_org_files