Refactor EnhancedContextPlugin to include user/llm breakdown in entity context

This commit is contained in:
2024-11-07 08:37:03 -05:00
parent fe6001e710
commit 9703332967
+3 -3
View File
@@ -329,11 +329,11 @@ class EnhancedContextPlugin(sm.BasePlugin):
for marker_type, markers in markers_by_type.items():
context_parts.append(f"- {marker_type.title()}: {', '.join(markers)}")
# Add entity context
# Add entity context with user/llm breakdown
if entities:
entity_strings = [
f"{entity} (mentioned {total} {'times' if total > 1 else 'time'})"
for entity, total, _, _ in entities
f"{entity} (mentioned {total} times - User: {user_count}, AI: {llm_count})"
for entity, total, user_count, llm_count in entities
]
topics = (