Add configuration files and update dependencies for Supabase functions
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { supabase } from "./new-user";
|
||||
|
||||
const file = Bun.file("files/carta.pdf");
|
||||
|
||||
await supabase.auth.signInWithPassword({
|
||||
email: "guillermo.arrieta@lasalle.mx",
|
||||
password: "admin",
|
||||
});
|
||||
|
||||
const fd = new FormData();
|
||||
fd.append("payload", JSON.stringify({
|
||||
response: { input: "Resume estos documentos en JSON.", model: "gpt-5" },
|
||||
structured: { type: "json_schema", name: "resumen", strict: true, schema: {
|
||||
type: "object", properties: { resumen: { type: "string" } }, required: ["resumen"], additionalProperties: false
|
||||
} },
|
||||
storage: { prefix: "tmp" },
|
||||
}));
|
||||
fd.append("files", file);
|
||||
|
||||
const response = await supabase.functions.invoke("ai-structured", {
|
||||
method: "POST",
|
||||
body: fd,
|
||||
});
|
||||
|
||||
console.log({ d: response.data, e: response.error });
|
||||
Reference in New Issue
Block a user