Skip to content

Commit c8e9bde

Browse files
committed
Fix issue with duplicate potential intents.
1 parent 2ebd6fa commit c8e9bde

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nemoguardrails/actions/v2_x/generation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ async def _collect_user_intent_and_examples(
159159
# We add these in reverse order so the most relevant is towards the end.
160160
for result in reversed(results):
161161
examples += f"user action: user said \"{result.text}\"\nuser intent: {result.meta['intent']}\n\n"
162-
potential_user_intents.append(result.meta["intent"])
162+
if result.meta["intent"] not in potential_user_intents:
163+
potential_user_intents.append(result.meta["intent"])
163164

164165
# We add all currently active user intents (heads on match statements)
165166
heads = find_all_active_event_matchers(state)

0 commit comments

Comments
 (0)