pensarPorElCerebro (bot/llm-proxy.ts)

vocero-crm · src/server/bot/llm-proxy.ts · typescript · MIT
crm, CRM / Leads

Module exposing: pensarPorElCerebro, LLM_PROXY_TIMEOUT_MS

// Source: https://github.com/kevinrivm/vocero-crm | License: MIT | Copyright 2026 Kevin Belier
// Provided via justclaw.it.com; keep this notice with the code.
import { apiRoot } from "@/lib/ai/presets";
import { resolveAiProvider } from "@/lib/ai/provider";
import { marcarEstadoPorRespuesta } from "@/server/ai/credentials";

/**
 * 036 — El CRM piensa por el cerebro (`POST /api/bot/llm/{ruta}`).
 *
 * Puerto de `/api/brains/llm` de la edición cloud. La llave de IA se pone una
 * vez, en Ajustes → IA, y no sale del CRM: el cerebro (Nea) apunta el
 * `base_url` de su SDK de OpenAI aquí y el CRM le pone la llave al reenviar.
 * Así quien instala no la copia a dos lugares, una filtrada no viaja, y
 * cuando el proveedor la rechaza (401, o 402 sin saldo) es el CRM quien se
 * entera y la paus

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key