get_from_context($context, 'keywords', ''); $topic = $this->get_from_context($context, 'topic', ''); if (!empty($research_context)) { $prompt .= "\n{$research_context}\n\n"; $prompt .= "IMPORTANT: Use the specific data, statistics, and examples from the research above to improve the article.\n\n"; } $prompt .= "Refinement Task: " . $this->get_refinement_instruction(); if (!empty($keywords)) { $prompt .= " Target keywords: {$keywords}."; } if (!empty($topic)) { $prompt .= " Main topic: {$topic}."; } if (!empty($research_context)) { $prompt .= " Use trending topics from the research."; } $prompt .= "\n\n"; $prompt .= "SEO Guidelines:\n"; $prompt .= "- Include target keywords in headings where natural\n"; $prompt .= "- Use descriptive H2 and H3 headings\n"; $prompt .= "- Ensure good keyword density without stuffing\n"; $prompt .= "- Add internal linking opportunities (suggest with placeholder links)\n"; $prompt .= "- Optimize meta-friendly opening paragraph\n\n"; $prompt .= $this->get_standard_requirements(!empty($research_context)); return $prompt; } }