Jokes Process Flow
Identify the Jokes Category
Jokes category is identified based on the User Request, Jokes are currently spoken by Aryan in English language only
If the user request is for "geeky/nerdy" jokes then the category is neutral
If the user request is for "Chuck Norris" jokes then the category is chuck
In case of no specific user request or neither of this categories then the category is defaulted as "all"
Get the Jokes
Python pyjokes package is used to get the Jokes based on Language and category.
Get Jokes for category as neutral
My_joke = pyjokes.get_joke(language="en", category="neutral")
PrintText(aifriend,"Geeky Joke for you is: " + My_joke)
SpeakText(aifriend,"Geeky Joke for you is: " + My_joke)
Get Jokes for category as neutral
My_joke = pyjokes.get_joke(language="en", category="chuck")
PrintText(aifriend,"Chuck Norris Joke for you is: " + My_joke)
SpeakText(aifriend,"Chuck Norris Joke for you is: " + My_joke)
Get Jokes for category as ALL
My_joke = pyjokes.get_joke(language="en", category="all")
PrintText(aifriend,"Joke for you is: " + My_joke)
SpeakText(aifriend,"Joke for you is: " + My_joke)
Respective jokes are provided to user and thereafter control is returned to NextStep
Last updated
Was this helpful?