mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-30 19:03:01 +01:00
Handle when summarize result is not present, rename variable in for loop from query
This commit is contained in:
parent
03544efde2
commit
717d9da8d8
2 changed files with 14 additions and 13 deletions
|
@ -717,16 +717,17 @@ async def chat(
|
|||
file_filters=conversation.file_filters if conversation else [],
|
||||
):
|
||||
if type(research_result) == InformationCollectionIteration:
|
||||
pending_research = False
|
||||
# if research_result.onlineContext:
|
||||
# researched_results += str(research_result.onlineContext)
|
||||
# online_results.update(research_result.onlineContext)
|
||||
if research_result.summarizedResult:
|
||||
pending_research = False
|
||||
# if research_result.onlineContext:
|
||||
# researched_results += str(research_result.onlineContext)
|
||||
# online_results.update(research_result.onlineContext)
|
||||
|
||||
# if research_result.context:
|
||||
# researched_results += str(research_result.context)
|
||||
# compiled_references.extend(research_result.context)
|
||||
# if research_result.context:
|
||||
# researched_results += str(research_result.context)
|
||||
# compiled_references.extend(research_result.context)
|
||||
|
||||
researched_results += research_result.summarizedResult
|
||||
researched_results += research_result.summarizedResult
|
||||
|
||||
else:
|
||||
yield research_result
|
||||
|
|
|
@ -211,13 +211,13 @@ async def execute_information_collection(
|
|||
direct_web_pages: Dict[str, Dict] = result # type: ignore
|
||||
|
||||
webpages = []
|
||||
for query in direct_web_pages:
|
||||
if online_results.get(query):
|
||||
online_results[query]["webpages"] = direct_web_pages[query]["webpages"]
|
||||
for web_query in direct_web_pages:
|
||||
if online_results.get(web_query):
|
||||
online_results[web_query]["webpages"] = direct_web_pages[web_query]["webpages"]
|
||||
else:
|
||||
online_results[query] = {"webpages": direct_web_pages[query]["webpages"]}
|
||||
online_results[web_query] = {"webpages": direct_web_pages[web_query]["webpages"]}
|
||||
|
||||
for webpage in direct_web_pages[query]["webpages"]:
|
||||
for webpage in direct_web_pages[web_query]["webpages"]:
|
||||
webpages.append(webpage["link"])
|
||||
yield send_status_func(f"**Read web pages**: {webpages}")
|
||||
|
||||
|
|
Loading…
Reference in a new issue