feat: update AI subject generation and handling responses
- Refactor AIGenerateSubjectInput type to include optional fields for updates. - Add handling for "asignaturas" responses in OpenAI webhook. - Implement crear.ts for creating/updating subjects based on AI responses. - Update tests to validate OpenAI file uploads instead of storage uploads.
This commit is contained in:
@@ -7,6 +7,7 @@ import "@supabase/functions-js/edge-runtime.d.ts";
|
||||
import OpenAI from "openai";
|
||||
import { ResponseMetadata } from "../_shared/utils.ts";
|
||||
import { handlePlanesEstudioResponse } from "./planes_estudio/index.ts";
|
||||
import { handleAsignaturasResponse } from "./asignaturas/index.ts";
|
||||
|
||||
console.log("Starting OpenAI webhook responses function");
|
||||
const client = new OpenAI({
|
||||
@@ -29,6 +30,9 @@ async function handleCompletedResponse(
|
||||
case "planes_estudio":
|
||||
await handlePlanesEstudioResponse(response);
|
||||
break;
|
||||
case "asignaturas":
|
||||
await handleAsignaturasResponse(response);
|
||||
break;
|
||||
default:
|
||||
console.warn("Tabla no reconocida:", metadata.tabla);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user