<?php
header('Content-Type: application/json');
require_once __DIR__ . '/../ai/LocalAIApi.php';

try {
    $response = LocalAIApi::createResponse([
        'input' => [
            ['role' => 'user', 'content' => 'Hello, tell me a short joke.']
        ]
    ]);

    echo json_encode($response);
} catch (Exception $e) {
    echo json_encode(['success' => false, 'error' => $e->getMessage()]);
}
