mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Show more informative title for semantic search train of thought
This commit is contained in:
@@ -1093,10 +1093,14 @@ async def event_generator(
|
|||||||
yield result
|
yield result
|
||||||
|
|
||||||
if not is_none_or_empty(compiled_references):
|
if not is_none_or_empty(compiled_references):
|
||||||
headings = "\n- " + "\n- ".join(set([c.get("compiled", c).split("\n")[0] for c in compiled_references]))
|
distinct_headings = set([d.get("compiled").split("\n")[0] for d in compiled_references if "compiled" in d])
|
||||||
|
distinct_files = set([d["file"] for d in compiled_references])
|
||||||
# Strip only leading # from headings
|
# Strip only leading # from headings
|
||||||
headings = headings.replace("#", "")
|
headings_str = "\n- " + "\n- ".join(distinct_headings).replace("#", "")
|
||||||
async for result in send_event(ChatEvent.STATUS, f"**Found Relevant Notes**: {headings}"):
|
async for result in send_event(
|
||||||
|
ChatEvent.STATUS,
|
||||||
|
f"**Found {len(distinct_headings)} Notes Across {len(distinct_files)} Files**: {headings_str}",
|
||||||
|
):
|
||||||
yield result
|
yield result
|
||||||
|
|
||||||
if conversation_commands == [ConversationCommand.Notes] and not await EntryAdapters.auser_has_entries(user):
|
if conversation_commands == [ConversationCommand.Notes] and not await EntryAdapters.auser_has_entries(user):
|
||||||
|
|||||||
Reference in New Issue
Block a user