Atualizar web/chat.js

This commit is contained in:
2026-08-19 21:03:13 -03:00
parent 25ca87a568
commit 4dc6f440af
+24
View File
@@ -28,6 +28,30 @@ function renderTabs() {
});
}
async function sendAudio() {
const file = document.getElementById("audioFile").files[0];
const form = new FormData();
form.append("file", file);
await fetch(`/api/audio/transcribe/${conversationId}`, {
method: "POST",
body: form
});
await loadHistory();
}
async function sendImage() {
const file = document.getElementById("visionFile").files[0];
const form = new FormData();
form.append("file", file);
await fetch(`/api/vision/${conversationId}`, {
method: "POST",
body: form
});
await loadHistory();
}
async function newConversation() {
const title = prompt("Conversation title:");
const r = await fetch("/api/new_conversation", {