Show more informative title for semantic search train of thought

This commit is contained in:
Debanjum
2025-07-03 16:05:42 -07:00
parent 7b7b1830b7
commit 0ecd5f497d

View File

@@ -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):