Skip to content

Instantly share code, notes, and snippets.

@ehzawad
Created November 14, 2022 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ehzawad/db7d9e41844863b56c9da043176afc0f to your computer and use it in GitHub Desktop.
Save ehzawad/db7d9e41844863b56c9da043176afc0f to your computer and use it in GitHub Desktop.
first = ['A']
second = ['B', 'C']
third = ['D', 'E', 'F']
intents_pack = [first, second, third]
if intents_pack.index(second) == 1:
print('Yes')
rasa_stories = [*first]
class Story:
def __init__(self, intents_pack):
self.intents_pack = intents_pack
def story_builder(self):
if intents_pack.index(second) == 1 and second.index('B') == 0:
rasa_stories.append(second[0])
def story_level(self):
if (any(x in second for x in rasa_stories)) == True:
if intents_pack.index(third) == 2 and third.index('F') == 2:
# print('Go to the third')
rasa_stories.append(third[2])
else:
print('Go to the hell')
def return_stories(self):
return rasa_stories
sample_intent = Story(intents_pack)
sample_intent.story_builder()
sample_intent.story_level()
print(sample_intent.return_stories())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment