ai impl
This commit is contained in:
@@ -16,9 +16,15 @@
|
||||
let description: string | undefined = $state();
|
||||
let isGenerating = $state(false);
|
||||
|
||||
async function onSelect() {
|
||||
async function onSelect(file: File) {
|
||||
isGenerating = true;
|
||||
description = await genDescription();
|
||||
|
||||
const buffer = await file.arrayBuffer();
|
||||
const base64 = btoa(
|
||||
String.fromCharCode(...new Uint8Array(buffer))
|
||||
);
|
||||
|
||||
description = await genDescription(base64);
|
||||
isGenerating = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user