From 4dc6f440afb263c9dc62bf663e8f05c6cca49365 Mon Sep 17 00:00:00 2001 From: Renato Rosa Date: Wed, 19 Aug 2026 21:03:13 -0300 Subject: [PATCH] Atualizar web/chat.js --- web/chat.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/web/chat.js b/web/chat.js index ef8ad8e..ae567a6 100644 --- a/web/chat.js +++ b/web/chat.js @@ -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", {