Praise be to Allah.
Al-Fayyoomi (may Allah have mercy on him) said:
The babgha (parrot) is a well-known bird. The word babgha may be masculine or feminine, and the plural is Babghawat.
Al-Misbah al-Muneer fi Ghareeb al-Sharh al-Kabeer, 1/35
It seems that it is not prescribed to return the greeting of a parrot which has learnt how to say salams (Islamic greeting), because saying salam is an act of worship and a supplication which requires intention on the part of the one who said it, and there is no such intention on the part of this trained creature. So one should not return its greeting. The ruling is the same as that on a tape on which the greeting is recorded and can be heard. It is a transmission of sound and does not come under the ruling on greeting when it is broadcast live, in which case returning the greeting is prescribed and is a communal obligation (fard kifayah).
Al-Shaykh Muhammad ibn Salih al-‘Uthaymeen (may Allah have mercy on him) said:
Sometimes the greeting may be recorded and they put it on the tape and run it. If it is recorded then you are not obliged to return the greeting, because this is just a transmission of sound.
Liqa’ al-Bab al-Maftooh, 28/229
See the rest of the fatwa and details on this issue in the answer to question number 128737.
Based on this, the parrot does not intend to give the greeting of salam, because it does not possess the power of reason, and when it speaks it is just repeating what it has been taught, without meaning what it says.
Some of the scholars have stated that it is not prescribed to prostrate if one hears a verse from a parrot or from a recorded tape.
One of the conclusions of the book Bahjat al-Asma‘ fi Ahkam al-Sama‘ fi’l-Fiqh al-Islami by Prof. ‘Ali ibn Dhariyan ibn Faris al-Hasan al-‘Anzi (published by Dar al-Manar in Kuwait) is:
The listener need not do the prostration of recitation if he hears it from a source that is not human, such as a trained bird like a parrot or hearing it from an echo. End quote.
And Allah knows best.