Move text_to_entries under the new content folder

This commit is contained in:
sabaimran 2023-11-21 22:25:17 -08:00
parent 1e2af083f0
commit c652a7fd2d
10 changed files with 13 additions and 12 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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"]

View file

@ -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,

View file

@ -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