up
This commit is contained in:
@@ -357,3 +357,27 @@ func LandingAdminList(c *fiber.Ctx) error {
|
||||
"page": page,
|
||||
})
|
||||
}
|
||||
|
||||
// ─── GET /landing/ai-config ───────────────────────────────────────────────────
|
||||
|
||||
// LandingGetAiConfig devuelve la configuración de IA activa para el Landing Generator.
|
||||
// Protegido por X-Landing-Secret.
|
||||
func LandingGetAiConfig(c *fiber.Ctx) error {
|
||||
if !landingSecret(c) {
|
||||
return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{"error": "no autorizado"})
|
||||
}
|
||||
config, err := models.GetActiveAiConfig("qwen")
|
||||
if err != nil {
|
||||
// Intentar cualquier provider activo como fallback
|
||||
config, err = models.GetActiveAiConfig("")
|
||||
if err != nil {
|
||||
return c.Status(fiber.StatusNotFound).JSON(fiber.Map{"error": "no hay configuración de IA activa"})
|
||||
}
|
||||
}
|
||||
return c.JSON(fiber.Map{
|
||||
"provider": config.Provider,
|
||||
"api_key": config.ApiKey,
|
||||
"base_url": config.BaseURL,
|
||||
"model_name": config.ModelName,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user