function pingChatbot() { // Your FastAPI endpoint URL var url = "https://amanm10000-mlsc-coherence-25-faq-chatbot-api.hf.space/chat"; // Create query parameters var params = { "question": "Who are the sponsors baby?" }; // Build URL with query parameters var queryString = Object.keys(params) .map(key => key + '=' + encodeURIComponent(params[key])) .join('&'); var fullUrl = url + '?' + queryString; // Request options var options = { "method": "get", "muteHttpExceptions": true }; try { // Make the request var response = UrlFetchApp.fetch(fullUrl, options); // Get response code and content var responseCode = response.getResponseCode(); var responseText = response.getContentText(); // Log the response Logger.log("Response Code: " + responseCode); Logger.log("Response: " + responseText); return responseText; } catch (error) { Logger.log("Error: " + error.toString()); return "Error: " + error.toString(); } }