From 737ebfd521d28f64a7df946cc35ac72952b47554 Mon Sep 17 00:00:00 2001 From: sabaimran Date: Fri, 3 May 2024 10:47:42 +0530 Subject: [PATCH] Make improvements to online search prompts and use a custom domain for automations emails --- src/khoj/processor/conversation/prompts.py | 13 +++++++++---- src/khoj/routers/email.py | 2 +- src/khoj/routers/helpers.py | 2 ++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/khoj/processor/conversation/prompts.py b/src/khoj/processor/conversation/prompts.py index 07e09436..695ea71b 100644 --- a/src/khoj/processor/conversation/prompts.py +++ b/src/khoj/processor/conversation/prompts.py @@ -414,8 +414,8 @@ History: User: I like to use Hacker News to get my tech news. AI: Hacker News is an online forum for sharing and discussing the latest tech news. It is a great place to learn about new technologies and startups. -Q: Summarize this post about vector database on Hacker News, https://news.ycombinator.com/item?id=12345 -Khoj: {{"links": ["https://news.ycombinator.com/item?id=12345"]}} +Q: Summarize top posts on Hacker News today +Khoj: {{"links": ["https://news.ycombinator.com/best"]}} History: User: I'm currently living in New York but I'm thinking about moving to San Francisco. @@ -460,8 +460,13 @@ History: User: I like to use Hacker News to get my tech news. AI: Hacker News is an online forum for sharing and discussing the latest tech news. It is a great place to learn about new technologies and startups. -Q: Summarize posts about vector databases on Hacker News since Feb 2024 -Khoj: {{"queries": ["site:news.ycombinator.com vector database since 1 February 2024"]}} +Q: Summarize the top posts on HackerNews +Khoj: {{"queries": ["top posts on HackerNews"]}} + +History: + +Q: Tell me the latest news about the farmers protest in Colombia and China on Reuters +Khoj: {{"queries": ["site:reuters.com farmers protest Colombia", "site:reuters.com farmers protest China"]}} History: User: I'm currently living in New York but I'm thinking about moving to San Francisco. diff --git a/src/khoj/routers/email.py b/src/khoj/routers/email.py index b1eb418e..03c3d78c 100644 --- a/src/khoj/routers/email.py +++ b/src/khoj/routers/email.py @@ -64,7 +64,7 @@ def send_task_email(name, email, query, result, subject): r = resend.Emails.send( { - "from": "Khoj ", + "from": "Khoj ", "to": email, "subject": f"✨ {subject}", "html": html_content, diff --git a/src/khoj/routers/helpers.py b/src/khoj/routers/helpers.py index 99e702f9..26a50893 100644 --- a/src/khoj/routers/helpers.py +++ b/src/khoj/routers/helpers.py @@ -172,6 +172,8 @@ def get_conversation_command(query: str, any_references: bool = False) -> Conver return ConversationCommand.General elif query.startswith("/online"): return ConversationCommand.Online + elif query.startswith("/webpage"): + return ConversationCommand.Webpage elif query.startswith("/image"): return ConversationCommand.Image elif query.startswith("/automated_task"):