Commit Graph

70 Commits

Author SHA1 Message Date
Guillermo.Arrieta c88bf044d0 estado de asignatura 'fallida' en los tipos 2026-02-27 12:30:05 -06:00
Guillermo.Arrieta c12e2895a8 Merge branch 'main' into issue/35-crear-webhook-para-responses 2026-02-27 12:14:04 -06:00
Guillermo.Arrieta 288278ea6c 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.
2026-02-27 12:07:06 -06:00
Guillermo.Arrieta 527f3aa56f Se inserta el plan de estudios y se mandan crear los datos generales en segundo plano, y la edge funcion de openai-webhook-responses recibe la respuesta para actualizar el plan de estudio con los datos generales 2026-02-25 17:39:09 -06:00
Guillermo.Arrieta 9263587f0b openai-webhook-responces recibe peticiones y hace log de las responses 2026-02-25 15:24:57 -06:00
roberto.silva 44919f074d Corregir Edge Function
fix#36
2026-02-25 14:42:42 -06:00
Guillermo.Arrieta 8aeb1d0a64 version con express js que no funciona 2026-02-25 12:17:59 -06:00
alexrg 824db85305 fix: simplify refusal handling in message response by removing is-refusal field
Deploy Function / deploy (push) Successful in 22s
Deploy Migrations to Production / deploy (push) Successful in 13s
2026-02-25 10:04:08 -06:00
alexrg 5fae2165b0 fix: change variable declaration from let to const for output in pickSchemaFields function
Deploy Function / deploy (push) Successful in 22s
Deploy Migrations to Production / deploy (push) Successful in 12s
2026-02-25 08:23:10 -06:00
alexrg 738d3970e3 fix: ensure campos is always an array in pickSchemaFields function
Deploy Function / deploy (push) Successful in 22s
Deploy Migrations to Production / deploy (push) Successful in 11s
2026-02-25 08:03:00 -06:00
alexrg 009e65d327 fix: remove required fields and additional properties from message schema
Deploy Function / deploy (push) Successful in 24s
Deploy Migrations to Production / deploy (push) Successful in 10s
2026-02-24 16:12:22 -06:00
alexrg e43927f1b1 fix: add required fields and restrict additional properties in message schema
Deploy Function / deploy (push) Successful in 22s
Deploy Migrations to Production / deploy (push) Successful in 11s
2026-02-24 15:28:56 -06:00
alexrg e906fe258c fix: remove unnecessary JSON.stringify for appended parameter in message handling
Deploy Function / deploy (push) Successful in 20s
Deploy Migrations to Production / deploy (push) Successful in 9s
2026-02-24 15:26:15 -06:00
alexrg 44c86cfa13 fix: rename parameter from p_appended to p_append in message handling
Deploy Function / deploy (push) Successful in 20s
Deploy Migrations to Production / deploy (push) Successful in 10s
2026-02-24 15:24:50 -06:00
alexrg 7ee9944ab5 feat: add @toon-format/toon dependency and integrate into OpenAI notebooks
- Updated deno.lock and package.json to include @toon-format/toon@^2.1.0.
- Modified background-openai.ipynb to handle error responses and adjust execution counts.
- Enhanced definitions-openai.ipynb to include additional metadata for perishables and origen schemas.
- Refactored embeddings-openai.ipynb to improve error handling and output formatting.
- Updated create-chat-conversation function to append messages and responses to conversations.
- Added SQL functions for appending conversation data to the database.
2026-02-24 15:20:19 -06:00
Guillermo.Arrieta 26c6ad7c20 close #31: Se genera el contenido temático con la IA 2026-02-23 17:06:34 -06:00
Guillermo.Arrieta 38e1488c8c Se añade un event listener que loggea cuando se va a apagar la función
Deploy Function / deploy (push) Successful in 22s
Deploy Migrations to Production / deploy (push) Successful in 11s
2026-02-19 13:06:34 -06:00
alexrg feaad85fda Actualizar supabase/functions/create-chat-conversation/lib/cors.ts
Deploy Function / deploy (push) Successful in 30s
Deploy Migrations to Production / deploy (push) Successful in 10s
2026-02-17 21:59:33 +00:00
alexrg 21469b3b4c Actualizar supabase/functions/create-chat-conversation/lib/cors.ts
Deploy Function / deploy (push) Successful in 32s
Deploy Migrations to Production / deploy (push) Successful in 9s
2026-02-17 21:55:45 +00:00
alexrg c28274334a Actualizar supabase/functions/create-chat-conversation/lib/plan.ts
fix #29
2026-02-16 23:35:10 +00:00
Guillermo.Arrieta a92fc6ac26 hotfix: prompt de formato arreglado para evitar que se muestren cosas como "\n" en el texto final
Deploy Function / deploy (push) Successful in 1m21s
Deploy Migrations to Production / deploy (push) Successful in 14s
2026-02-16 17:25:38 -06:00
Guillermo.Arrieta 5a23be9961 Se añadieron indicaciones de formato en los prompts para generación de plan o de asignatura
Deploy Function / deploy (push) Successful in 39s
Deploy Migrations to Production / deploy (push) Successful in 11s
close #26
2026-02-16 19:52:21 +00:00
Guillermo.Arrieta e64c0de529 Se usan modelos de openai a partir de variables de entorno 2026-02-16 19:52:21 +00:00
alexrg 13cf57505f Merge branch 'main' of https://github.lci.ulsa.mx/AlexRG/genesis-2
Deploy Function / deploy (push) Successful in 26s
Deploy Migrations to Production / deploy (push) Successful in 11s
2026-02-13 16:12:26 -06:00
alexrg 9d25203ef6 fix: update execution counts and improve message parsing in chat conversation functions 2026-02-13 16:12:23 -06:00
Guillermo.Arrieta 7a81e448f4 hotfix: se cambió el estado default de las asignaturas y se arregló un error donde se requería código de asignatura no nulo
Deploy Function / deploy (push) Successful in 44s
Deploy Migrations to Production / deploy (push) Successful in 14s
2026-02-13 12:39:14 -06:00
alexrg b7720496cf feat: update conversation archiving to store structured message data
CI / test (pull_request) Failing after 7s
2026-02-13 10:17:06 -06:00
alexrg a70f0c52a9 feat: implement create-chat-conversation function with OpenAI integration and Supabase support
CI / test (pull_request) Failing after 8s
- Added CORS handling for the create-chat-conversation function.
- Implemented health check endpoint for the function.
- Created endpoints for managing conversations and messages with OpenAI.
- Added error handling and response formatting for better API usability.
- Introduced utility functions for environment variable management and Supabase client creation.
- Enhanced schema handling for structured responses from OpenAI.
- Implemented conversation archiving and retrieval logic.
2026-02-13 09:31:58 -06:00
Guillermo.Arrieta f29465958a errores de imports
Deploy Function / deploy (push) Successful in 37m53s
Deploy Migrations to Production / deploy (push) Successful in 15s
2026-02-12 17:40:22 -06:00
Guillermo.Arrieta 9981b30260 feat: update subject suggestion guidelines and remove obsolete migration
CI / test (pull_request) Failing after 8s
- Enhanced the subject suggestion guidelines to specify that descriptions must not exceed 200 characters.
- Deleted the migration file for adding conversation_id to asignaturas and the associated view, as it is no longer needed.
2026-02-12 16:45:38 -06:00
Guillermo.Arrieta 2ff587d639 feat: opcion de update a asignaturas ya creadas para ponerles la información generada con IA
- Created a new enum type "estado_asignatura" with values 'borrador', 'revisada', 'aprobada', and 'generando'.
- Added a new column "estado" to the "asignaturas" table, defaulting to 'generando'.
- Implemented a trigger function to log changes in the "planes_estudio" table, capturing inserts, updates, and deletes.
- Updated the logging mechanism to track changes in various fields, including JSONB data.
- Removed the "asignaturas" table from the supabase_realtime publication.
- Added a script for generating TypeScript types from the local Supabase database.
2026-02-12 16:00:39 -06:00
Guillermo.Arrieta 48ab986cb8 Actualizar esquema de validación: limitar la descripción a 200 caracteres y reducir la cantidad máxima de sugerencias a 15 2026-02-12 16:00:00 -06:00
Guillermo.Arrieta 24b6338074 Implementar validación y generación de sugerencias de asignaturas con integración a Supabase 2026-02-12 16:00:00 -06:00
Guillermo.Arrieta b1d431a683 Generación con IA funcional 2026-02-12 16:00:00 -06:00
Guillermo.Arrieta ce5360a5c2 wip 2026-02-12 16:00:00 -06:00
Guillermo.Arrieta 93c7f11621 nueva edge function para la generación de sugerencais de asignaturas con IA 2026-02-12 16:00:00 -06:00
alexrg bdd4921795 Add initial implementation for create-chat-conversation function and related configuration files 2026-02-12 11:59:22 -06:00
alexrg 484db49654 Refactor code structure for improved readability and maintainability 2026-02-12 10:35:52 -06:00
alexrg 834e884c90 Remove deprecated AI function and related configuration files for cleaner project structure 2026-02-12 09:47:58 -06:00
Guillermo.Arrieta 5c9fde1a9e Generación de datos básicos de asignaturas funcional
Deploy Function / deploy (push) Successful in 24s
close #6:
- Ya se pueden generar asignaturas con IA. Específicamente los datos generales.
- Se actualizaron los tipos de supabase
- Se arreglaron los imports
- TODO: generar contenido temático de la asignatura
2026-02-05 19:42:12 -06:00
Guillermo.Arrieta 7f9226ce38 hotfix de importacion
Deploy Function / deploy (push) Successful in 21s
2026-02-05 16:13:55 -06:00
Guillermo.Arrieta 00f0bddf1c Arreglo de reverts 2026-02-05 16:00:07 -06:00
Guillermo.Arrieta 1ca861c51d Primera versión de la función de ai-generate-subject 2026-02-05 15:54:04 -06:00
Guillermo.Arrieta 42a437afa3 fix(functions): clasificar y estandarizar errores en ai-generate-plan
- Corregido el problema donde la función devolvía siempre 400; ahora se lanzan HttpError con status adecuados (405, 401, 415, 422, 404, 409, 502, 500) según el caso.
- Refactor: usar sendError/sendSuccess y HttpError desde _shared/utils.ts para respuestas consistentes y logging seguro.
- Validación: agrupar errores de parse/validación en un único mensaje numerado (cada error en nueva línea).
- OpenAI: manejo explícito de fallos (MissingEnv, JSON inválido, salida estructurada ausente) y mapeo a status apropiados.
- Supabase: distinguir errores 404/409/500 en consultas e inserts; incluir detalles en internalDetails para diagnóstico server-side.
- Eliminada dependencia de invocación HTTP a ai-structured; usar servicio compartido directo.
- Ajustes menores en mensajes y configuración (deno imports/deno.json) y tests marcados como ignorados donde corresponde.
2026-02-05 15:54:04 -06:00
Guillermo.Arrieta 7660d2c3a0 inicio de funcion de generación de asignatura 2026-02-05 15:53:23 -06:00
alexrg b1a90858dc revert 1af0358e65
Deploy Function / deploy (push) Failing after 43s
revert Merge pull request 'REFACTOR OpenAI service to manage env and convo creation' (#12) from issue/9-hacer-una-funcin-que-inserte-el-id-de-conversacin into main

Reviewed-on: AlexRG/genesis-2#12
2026-02-05 20:41:28 +00:00
roberto.silva 132a51133b revert e1d865e6c3
Deploy Function / deploy (push) Failing after 45s
revert posible solución a issue #60
2026-02-05 16:11:09 +00:00
alexrg 0b7d2e83d7 Refactor OpenAI service to manage env and convo creation
- Add fromEnv factory to OpenAIService to handle env vars
- Move conversation creation into OpenAIService
- Update create- chat-conversation function to use new OpenAIService
  methods
- Add CORS headers to responses
2026-02-03 09:38:56 -06:00
alexrg e024057e47 Add create-chat-conversation function and related configurations 2026-02-03 09:26:30 -06:00
Guillermo.Arrieta e1d865e6c3 posible solución a issue #60
Deploy Function / deploy (push) Successful in 21s
2026-01-30 12:24:59 -06:00