The Parrot is built from the Lego Spike Essential educational kit. In order for the parrot to start swinging on the perch, you need to put the red ball in the plate, which will trigger the color sensor and start the program
The set includes step-by-step building instruction and an example of program (in Spike environment).