<?php
require_once __DIR__ . '/ai/LocalAIApi.php';

$prompt = "You are the 'Bro' editor for 'Real Bro Blog'. Generate 3 'Bro Tips of the Week' and 1 'Bro Manifesto' intro for the homepage. Keep it casual, high-energy, and related to beer, parties, and lifestyle. Output in JSON format with keys 'tips' (array of strings) and 'manifesto' (string).";

$resp = LocalAIApi::createResponse(
    [
        'input' => [
            ['role' => 'system', 'content' => 'You are a bro-culture content creator.'],
            ['role' => 'user', 'content' => $prompt],
        ],
    ]
);

if (!empty($resp['success'])) {
    $text = LocalAIApi::extractText($resp);
    echo $text;
} else {
    echo "AI Error: " . ($resp['error'] ?? 'unknown');
}
