Implementation of the chat function
Implementation of the chat function