 }),
    });
    const responseJson = await response.json();
    const outputText = responseJson.answer;
    // Display the conversation in the chatbox
    chatbox.innerHTML += `<p><strong>You:</strong> ${question}</p>`;
    chatbox.innerHTML += `<p><strong>DataberryBot:</strong> ${outputText}</p>`;
    chatbox.scrollTop = chatbox.scrollHeight;

    // Check if WebSocket connection is open before sending message to the server
    if (ws.readyState === WebSocket.OPEN) {
      const message = JSON.