feat: user stt language

This commit is contained in:
Timothy Jaeryang Baek
2025-05-24 00:36:30 +04:00
parent 9946dc7b5f
commit baaa285534
14 changed files with 149 additions and 103 deletions
+5 -1
View File
@@ -1,8 +1,12 @@
import { WEBUI_API_BASE_URL } from '$lib/constants';
export const uploadFile = async (token: string, file: File) => {
export const uploadFile = async (token: string, file: File, metadata?: object | null) => {
const data = new FormData();
data.append('file', file);
if (metadata) {
data.append('metadata', JSON.stringify(metadata));
}
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/files/`, {