function send()

in cloud-run-gemini-chat/Application/CloudRun/Python-Flask/static/app.js [38:58]


function send(token, topic, model) {
	fetch("ask", {
		method: "POST",
		headers: {
			'X-CSRFToken': token,
			'Content-type': "application/json"
		},
		body: JSON.stringify({ token: token, text: topic, model: model })
	})
	.then(response => {
		return response.json();
	})
	.then(data => {
		document.querySelector('#output').innerHTML = data["text"];
		toggleSubmitButton();
	})
	.catch(error => {
		console.log(error)
		toggleSubmitButton();
	})
}