Se usan modelos de openai a partir de variables de entorno

This commit is contained in:
2026-02-16 13:03:15 -06:00
committed by Guillermo.Arrieta
parent 34162c6038
commit e64c0de529
4 changed files with 30 additions and 6 deletions
+5 -1
View File
@@ -118,6 +118,10 @@ Deno.serve(async (req: Request): Promise<Response> => {
SERVICE_ROLE_KEY,
);
// Model name controlled via env var (single use)
const AI_GENERATE_PLAN_MODELO = Deno.env.get("AI_GENERATE_PLAN_MODELO") ??
"gpt-5-nano";
const formData = await req.formData();
const validation = parseAndValidate(formData);
if (!validation.success) {
@@ -185,7 +189,7 @@ Deno.serve(async (req: Request): Promise<Response> => {
: {};
const aiStructuredPayload: StructuredResponseOptions = {
model: "gpt-5-nano",
model: AI_GENERATE_PLAN_MODELO,
input: [
{ role: "system", content: systemPrompt },
{ role: "user", content: userPrompt },