From 970333296796c0b3bb204274a04c8feb9d256a9d Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 7 Nov 2024 08:37:03 -0500 Subject: [PATCH] Refactor EnhancedContextPlugin to include user/llm breakdown in entity context --- examples/enhanced_context.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/enhanced_context.py b/examples/enhanced_context.py index f8e3234..944cc87 100644 --- a/examples/enhanced_context.py +++ b/examples/enhanced_context.py @@ -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 = (