In the Kazuo Ishiguro 2021 novel Klara and the Sun the main character is an "artificial friend", i.e., a construction intended to be a child's companion. The idea of a child's robot companion is not new; in fact, I believe I have run across the phrase "artificial friend" used in this sense in an earlier story, but I cannot recall which. Can anyone point to an earlier story using this phrase in that sense?
Here’s a notable early example of the phrase being used in this sense:
A certain robot, planning to go on a long and dangerous voyage, heard of a most useful device which its inventor called an electric friend. He would feel better, he thought, if he had a companion, even a companion that was only a machine, so he went to the inventor and asked to be shown an artificial friend.
Stanisław Lem (1972). ‘Automatthew’s Friend’. In Cyberiada, 3rd edition. Cracow: Wydawnictwo Literackie. Translated by Michael Kandel (1977). Mortal Engines, p. 79. New York: Seabury.