Atualizar web/chat.js
This commit is contained in:
+24
@@ -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() {
|
async function newConversation() {
|
||||||
const title = prompt("Conversation title:");
|
const title = prompt("Conversation title:");
|
||||||
const r = await fetch("/api/new_conversation", {
|
const r = await fetch("/api/new_conversation", {
|
||||||
|
|||||||
Reference in New Issue
Block a user