// ... (بقیه کد بالا همان باشد)

private function generate_content($title, $cat_name) {
    $prompt = "مقاله کامل فارسی درباره '{$title}' در حوزه {$cat_name} بنویس.";

    if (empty($this->hf_token)) {
        return "<h2>{$title}</h2><p>❌ توکن Hugging Face وارد نشده است.</p>";
    }

    $response = wp_remote_post('https://api-inference.huggingface.co/models/mistralai/Mistral-7B-Instruct-v0.3', [
        'headers' => [
            'Authorization' => 'Bearer ' . $this->hf_token,
            'Content-Type'  => 'application/json',
        ],
        'body' => json_encode([
            'inputs' => $prompt,
            'parameters' => ['max_new_tokens' => 1500, 'temperature' => 0.7]
        ]),
        'timeout' => 80
    ]);

    if (is_wp_error($response)) {
        $error_msg = $response->get_error_message();
        return "<h2>{$title}</h2><p>❌ خطا در ارتباط: {$error_msg}</p>";
    }

    $body = json_decode(wp_remote_retrieve_body($response), true);
    
    if (isset($body['error'])) {
        return "<h2>{$title}</h2><p>❌ خطای Hugging Face: " . $body['error'] . "</p>";
    }

    $text = $body[0]['generated_text'] ?? '';
    
    if (empty($text)) {
        return "<h2>{$title}</h2><p>❌ محتوا خالی برگشت. توکن یا مدل مشکل دارد.</p>";
    }

    return wpautop($text);
}<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//spamagezine.ir/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://spamagezine.ir/post-sitemap.xml</loc>
		<lastmod>2026-07-01T11:15:05+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://spamagezine.ir/page-sitemap.xml</loc>
		<lastmod>2026-02-03T13:00:07+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://spamagezine.ir/category-sitemap.xml</loc>
		<lastmod>2026-07-01T11:15:05+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Yoast SEO -->