mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-06 05:39:12 +00:00
Give more readable name to document search tool
This commit is contained in:
@@ -357,7 +357,7 @@ def set_user_name(
|
|||||||
return {"status": "ok"}
|
return {"status": "ok"}
|
||||||
|
|
||||||
|
|
||||||
async def extract_references_and_questions(
|
async def search_documents(
|
||||||
user: KhojUser,
|
user: KhojUser,
|
||||||
chat_history: list[ChatMessageModel],
|
chat_history: list[ChatMessageModel],
|
||||||
q: str,
|
q: str,
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ from khoj.processor.tools.online_search import (
|
|||||||
search_online,
|
search_online,
|
||||||
)
|
)
|
||||||
from khoj.processor.tools.run_code import run_code
|
from khoj.processor.tools.run_code import run_code
|
||||||
from khoj.routers.api import extract_references_and_questions
|
from khoj.routers.api import search_documents
|
||||||
from khoj.routers.email import send_query_feedback
|
from khoj.routers.email import send_query_feedback
|
||||||
from khoj.routers.helpers import (
|
from khoj.routers.helpers import (
|
||||||
ApiImageRateLimiter,
|
ApiImageRateLimiter,
|
||||||
@@ -1161,7 +1161,7 @@ async def chat(
|
|||||||
## Extract Document References
|
## Extract Document References
|
||||||
if not ConversationCommand.Research in conversation_commands:
|
if not ConversationCommand.Research in conversation_commands:
|
||||||
try:
|
try:
|
||||||
async for result in extract_references_and_questions(
|
async for result in search_documents(
|
||||||
user,
|
user,
|
||||||
chat_history,
|
chat_history,
|
||||||
q,
|
q,
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ from khoj.processor.conversation.utils import (
|
|||||||
from khoj.processor.operator import operate_environment
|
from khoj.processor.operator import operate_environment
|
||||||
from khoj.processor.tools.online_search import read_webpages, search_online
|
from khoj.processor.tools.online_search import read_webpages, search_online
|
||||||
from khoj.processor.tools.run_code import run_code
|
from khoj.processor.tools.run_code import run_code
|
||||||
from khoj.routers.api import extract_references_and_questions
|
from khoj.routers.api import search_documents
|
||||||
from khoj.routers.helpers import (
|
from khoj.routers.helpers import (
|
||||||
ChatEvent,
|
ChatEvent,
|
||||||
generate_summary_from_files,
|
generate_summary_from_files,
|
||||||
@@ -313,7 +313,7 @@ async def research(
|
|||||||
previous_inferred_queries = {
|
previous_inferred_queries = {
|
||||||
c["query"] for iteration in previous_iterations if iteration.context for c in iteration.context
|
c["query"] for iteration in previous_iterations if iteration.context for c in iteration.context
|
||||||
}
|
}
|
||||||
async for result in extract_references_and_questions(
|
async for result in search_documents(
|
||||||
user,
|
user,
|
||||||
construct_tool_chat_history(previous_iterations, ConversationCommand.Notes),
|
construct_tool_chat_history(previous_iterations, ConversationCommand.Notes),
|
||||||
this_iteration.query,
|
this_iteration.query,
|
||||||
|
|||||||
Reference in New Issue
Block a user