Our Gemara on Amud Aleph tries to understand a strange declaration made by the protagonist in the Mishna. The fellow is frustrated with his cow that is refusing to budge, and declares, “This cow says, I am hereby a Nazir if I get up.” Obviously, the cow cannot make declarations. The Gemara explains, when the person said “this cow says”, he meant to say, “this cow THINKS she is not going to get up…and then the person makes an oath in frustration.”
You might have a problem with a cow thinking as well, even if not talking. However, the Gemara in other places attributes thought, in the form of intention, to cows (see Bava Kama 2b, “Kavvanaso Lehazik”.) Intention is different than intelligence and reason, and according to the Gemara, even an animal can have intention.
The Peri Tzaddik (Yisro 11) uses this idea that thinking can sometimes be equated with speech to explain a difficulty with the introductory verse to the Aseres Hadibros:
וַיְדַבֵּ֣ר אלקים אֵ֛ת כׇּל־הַדְּבָרִ֥ים הָאֵ֖לֶּה לֵאמֹֽר
God spoke all these words, saying
Usually, the construct “לאמר” “saying”, is translated as, “commanded to say.” As in, וידבר ה׳ אל משה לאמר “Hashem spoke to Moshe, instructing him to say…”. However, in this usage, it is God talking directly, as the first commandments were heard by the Jews direct from God and not from Moshe (See Devarim 5:19-25.) How are we then to understand the word לאמר to say in this verse?
Peri Tzaddik, referencing our Gemara, says here it means, “to think.” The essence of the Torah is not in its written form, it is the attitude and intentions that grow out of contemplation and understanding. Hashem was giving written words in the form of the Ten Commandments hewn in stone, but was asking the Jews to conduct an inner dialogue to find depth and meaning between the lines.