<?php
require_once __DIR__ . '/../_pdo_db_connect.php';
require_once __DIR__ . '/../_response.php';
require_once __DIR__ . '/../_middleware/auth_check.php';
$payload = require_auth();
$input = json_decode(file_get_contents('php://input'), true);
$prompt = $input['prompt'] ?? '';
if (!$prompt) json_res(['error'=>'missing_prompt'],400);
// TODO: integrate actual LLM provider using server-side key in .env
json_res(['answer'=>"Stub: received prompt (".strlen($prompt)." chars). Integrate your LLM provider."]);
