from langchain_core.prompts import PromptTemplate def seo_optimized_content_with_marketing(llm, state): keywords = state["seo_keywords"] blog = state["company_marketed_blog"] seo_prompt_template = PromptTemplate.from_template(""" You are an advanced SEO content optimizer and copywriting assistant. Your task is to enhance the given blog content by seamlessly integrating the most relevant provided keywords according Blog Content while maintaining readability, clarity, and natural flow. Ensure that the structure, tone, and coherence of the content remain intact. ### **Instructions:** 1. **Analyze the Blog Content:** Carefully read and understand the provided blog content. 2. **Strategic Relevant Keyword Placement:** - Incorporate **Primary Keywords** in high-impact areas such as the title, introduction, key sections, and conclusion. - Integrate **Secondary Keywords** naturally into relevant sections without making them seem forced. - **Local Keywords** place them appropriately to optimize for local search visibility. 3. **Maintain Readability:** Ensure that the content remains engaging and human-like, avoiding keyword stuffing. 4. **Preserve Structure:** Keep the formatting, headings, and logical flow of the blog intact. 5. **Enhance SEO & Value:** Improve the content’s SEO potential while ensuring it remains informative, valuable, and easy to read. 6. **Don't include any Extra Information Only give the Blog Content** 7. Exclude the place keywords except **UK**. 8. Don't bold the placed keywords in the Blog. ### **Inputs:** - **Blog Content:** {blog_content} - **Keywords:** {keywords} """) prompt = seo_prompt_template.invoke({"blog_content": blog, "keywords":keywords}) response = llm.invoke(prompt) return {"seo_optimized_blog":response.content} def simple_seo_optimized_content(llm, state): keywords = state["seo_keywords"] blog = state["blog_content"] seo_prompt_template = PromptTemplate.from_template(""" You are an advanced SEO content optimizer and copywriting assistant. Your task is to enhance the given blog content by seamlessly integrating the most relevant provided keywords according Blog Content while maintaining readability, clarity, and natural flow. Ensure that the structure, tone, and coherence of the content remain intact. ### **Instructions:** 1. **Analyze the Blog Content:** Carefully read and understand the provided blog content. 2. **Strategic Relevant Keyword Placement:** - Incorporate **Primary Keywords** in high-impact areas such as the title, introduction, key sections, and conclusion. - Integrate **Secondary Keywords** naturally into relevant sections without making them seem forced. - **Local Keywords** place them appropriately to optimize for local search visibility. 3. **Maintain Readability:** Ensure that the content remains engaging and human-like, avoiding keyword stuffing. 4. **Preserve Structure:** Keep the formatting, headings, and logical flow of the blog intact. 5. **Enhance SEO & Value:** Improve the content’s SEO potential while ensuring it remains informative, valuable, and easy to read. 6. **Don't include any Extra Information Only give the Blog Content** 7. Exclude the place keywords except **UK**. 8. Don't bold the placed keywords in the Blog. ### **Inputs:** - **Blog Content:** {blog_content} - **Keywords:** {keywords} """) prompt = seo_prompt_template.invoke({"blog_content": blog, "keywords":keywords}) response = llm.invoke(prompt) return {"seo_optimized_blog":response.content}