stringify({ text: outputText });
      ws.send(message);
    }
  } catch (error) {
    console.error(error);
  }
}

// Use the received text as the question input for the chatbot and display the conversation
function handleServerMessage(event) {
  // Extract the received text message from the event object
  const receivedText = event.data;
  // Ask the chatbot the received question
  askQuestion(receivedText);
}
    // Add a click event listener to the 'connect to server' button
    connecto