29 lines
797 B
TypeScript
29 lines
797 B
TypeScript
import { supabase } from "./new-user";
|
|
|
|
const /* { data, error } */_ = await supabase.auth.signInWithPassword({
|
|
email: "guillermo.arrieta@lasalle.mx",
|
|
password: "admin",
|
|
});
|
|
|
|
/* if (error) {
|
|
console.error("Error signing in:", error);
|
|
process.exit(1);
|
|
} else {
|
|
console.log("Successfully signed in:", data);
|
|
} */
|
|
|
|
try {
|
|
|
|
const response = await supabase.functions.invoke("ai-structured", {
|
|
body: {
|
|
query: "Escribe un poema sobre la primavera en español",
|
|
},
|
|
});
|
|
console.log({ d: response.data, e: response.error });
|
|
} catch (e: any) {
|
|
const res = e?.context ?? e?.response;
|
|
console.log("status", res?.status);
|
|
if (res?.text) console.log("text", await res.text());
|
|
else console.log("raw error keys", Object.keys(e ?? {}));
|
|
}
|