mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Correct usage of the summarize function
This commit is contained in:
@@ -783,7 +783,7 @@ async def chat(
|
||||
async for result in send_llm_response(response_log):
|
||||
yield result
|
||||
else:
|
||||
response_log = await generate_summary_from_files(
|
||||
async for response in generate_summary_from_files(
|
||||
q=q,
|
||||
user=user,
|
||||
file_filters=file_filters,
|
||||
@@ -791,7 +791,9 @@ async def chat(
|
||||
subscribed=subscribed,
|
||||
send_status_func=partial(send_event, ChatEvent.STATUS),
|
||||
send_response_func=partial(send_llm_response),
|
||||
)
|
||||
):
|
||||
yield response
|
||||
|
||||
await sync_to_async(save_to_conversation_log)(
|
||||
q,
|
||||
response_log,
|
||||
|
||||
@@ -245,14 +245,25 @@ async def execute_information_collection(
|
||||
)
|
||||
)
|
||||
else:
|
||||
response_log = await generate_summary_from_files(
|
||||
async for response in generate_summary_from_files(
|
||||
q=query,
|
||||
user=user,
|
||||
file_filters=file_filters,
|
||||
meta_log=conversation_history,
|
||||
subscribed=subscribed,
|
||||
send_status_func=send_status_func,
|
||||
)
|
||||
):
|
||||
if isinstance(response, dict) and ChatEvent.STATUS in response:
|
||||
yield response[ChatEvent.STATUS]
|
||||
else:
|
||||
response_log = response
|
||||
previous_iterations.append(
|
||||
InformationCollectionIteration(
|
||||
data_source=this_iteration.data_source,
|
||||
query=this_iteration.query,
|
||||
context=response_log,
|
||||
)
|
||||
)
|
||||
else:
|
||||
iteration = MAX_ITERATIONS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user