Chatterbox Basics: Listening and Speaking
Hey there, future AI coders! Are you ready to turn Chatterbox into your own talking AI? This cool speaker can listen and chat, but it needs your help to learn how. Let's dive in and teach Chatterbox some fun skills!
π€ How do we teach Chatterbox how to 'Listen' and 'Speak'?
Chatterbox is like a robot friend that's waiting to hear your commands. You can teach it new tricks, called "Skills," using colorful blocks that fit together like a puzzle. Each skill is a special "ability" Chatterbox can do because you've programmed it!
Chatterbox only listens when you press the big yellow button on its head. It's like saying "Hey, Chatterbox, it's time to listen!" It does this to respect privacy by not always listening, but remember, it will only respond to the words you've taught it.
π How to Make Chatterbox Listen
Want Chatterbox to listen for the word "hello"? Grab the When I hear block and tell it to listen for "hello." If Chatterbox hears it, it will do whatever you've set up inside that block.
Important: The 'When I hear' block is like the starting line for all Skills. If Chatterbox doesn't hear the right word, it'll just say, "I don't know how to do that, but you can teach me."
π£οΈ How to Make Chatterbox Talk
To make Chatterbox talk, use the Speak block. It's like giving Chatterbox words to say! But for it to work, you need to connect it with the When I hear block.
Want Chatterbox to say a bunch of things one after the other? Stack those Speak blocks, and it'll talk in the order you've set.
Feeling lucky? Use the Speak Random block, and Chatterbox will surprise you with a random phrase from the options you give it.
π Ready for the Skill Challenge?
Using the Listen and Speak blocks, try building the following skills.
- Tell me a joke: Make a skill that turns Chatterbox into your personal jokester.
- Flip a coin: Can't decide something? Let Chatterbox choose for you with a coin flip.
- Ask the crystal ball: Create a skill for some fun pretend fortune-telling like a Magic 8-ball!
β Review
We learned how to make Chatterbox Listen and Speak using the When I Hear block and
the Speak and Speak Random blocks.
Question: What happens if there isnβt an exact match of the When I Hear phrase?