mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 13:18:18 +00:00
Pass query params to doc search function before user, chat history
Makes document search arg ordering more consistent with other tools like online search, run code etc.
This commit is contained in:
@@ -1064,11 +1064,11 @@ async def chat(
|
||||
if not ConversationCommand.Research in conversation_commands:
|
||||
try:
|
||||
async for result in search_documents(
|
||||
user,
|
||||
chat_history,
|
||||
q,
|
||||
(n or 7),
|
||||
d,
|
||||
user,
|
||||
chat_history,
|
||||
conversation_id,
|
||||
conversation_commands,
|
||||
location,
|
||||
|
||||
@@ -1159,11 +1159,11 @@ async def generate_better_image_prompt(
|
||||
|
||||
|
||||
async def search_documents(
|
||||
user: KhojUser,
|
||||
chat_history: list[ChatMessageModel],
|
||||
q: str,
|
||||
n: int,
|
||||
d: float,
|
||||
user: KhojUser,
|
||||
chat_history: list[ChatMessageModel],
|
||||
conversation_id: str,
|
||||
conversation_commands: List[ConversationCommand] = [ConversationCommand.Default],
|
||||
location_data: LocationData = None,
|
||||
|
||||
@@ -313,11 +313,11 @@ async def research(
|
||||
c["query"] for iteration in previous_iterations if iteration.context for c in iteration.context
|
||||
}
|
||||
async for result in search_documents(
|
||||
user,
|
||||
construct_tool_chat_history(previous_iterations, ConversationCommand.Notes),
|
||||
this_iteration.query,
|
||||
max_document_searches,
|
||||
None,
|
||||
user,
|
||||
construct_tool_chat_history(previous_iterations, ConversationCommand.Notes),
|
||||
conversation_id,
|
||||
[ConversationCommand.Default],
|
||||
location,
|
||||
|
||||
Reference in New Issue
Block a user