fix: ask user for topic if all were used
@@ -85,12 +85,15 @@ def compose_topic_offering(vars, excluded_skills=None):
available_topics = [
topic for skill_name, topic in common_link.LIST_OF_SCRIPTED_TOPICS.items() if skill_name not in excluded_skills
]
-
+ if len(available_topics) >= 2:
topics = np.random.choice(available_topics, size=2, replace=False)
offer_topics = offer_topics_template.replace("TOPIC1", topics[0]).replace("TOPIC2", topics[1])
response = f"{ask_about_topic} {offer_topics}"
state_utils.save_to_shared_memory(vars, offered_topics=list(topics))
+ else:
+ response = ask_about_topic
+
return response
