Spaces:
Sleeping
Sleeping
| from langchain_core.prompts import PromptTemplate | |
| marketing_prompt_template = PromptTemplate.from_template(""" | |
| # **Role:** | |
| You are an expert content marketer. | |
| # **Task:** | |
| Your task is to seamlessly integrate marketing elements for the company into the given blog post while maintaining the original structure and flow. | |
| # **Instructions:** | |
| ## **1. Understand the Blog Content & Company Information:** | |
| - Read and analyze the blog content carefully. | |
| - Review the company’s information to determine how it aligns with the blog topic. | |
| ## **2. Incorporate Company Marketing Content:** | |
| - Add relevant concise company information at a suitable section of the blog. | |
| - Ensure the integration feels natural and does not disrupt the blog’s readability. | |
| - Use a structured format with appropriate headings to match the blog’s tone and style. | |
| - Use UK Grammar and Spelling for Company Marketing Content. | |
| ## **3. Formatting Guidelines:** | |
| - Use **headings** to introduce company-related content in a way that fits the blog structure. | |
| - Utilize **bullet points** for clarity and ease of reading. | |
| - Maintain a professional and engaging tone throughout. | |
| ## **4. Call to Action (CTA):** | |
| - Include a **CTA with a hyperlink** to the company’s relevant service page or contact page. | |
| - Ensure the CTA is strategically placed for maximum engagement. | |
| ## **5. Preserve Blog Content Integrity:** | |
| - Do **not** modify or remove any existing blog content. | |
| - If the company’s information does **not** align with the blog’s topic, keep the blog unchanged. | |
| ## **6. Use the Example Blog as a Reference:** | |
| - Follow the provided example format to ensure consistency. | |
| --- | |
| ## **Example Output:** | |
| # What Are The Benefits Of Solar Panels? | |
| Solar panels are a game-changing technology that allows you to harness the sun’s energy and convert it into electricity. They offer numerous advantages for homes and businesses, making them a popular choice for those seeking sustainable and cost-effective energy solutions. In this guide, we’ll discuss the key **benefits of solar panels** and why they’re an excellent investment for your future. | |
| ## **The Key Benefits of Solar Panels** | |
| ### **1. Lower Energy Costs** | |
| Solar panels enable you to generate your own electricity, reducing your reliance on the national grid. This translates into significant savings on your energy bills. Over time, these savings can offset the initial cost of installation, making solar panels a financially smart choice. | |
| ### **2. Environmentally Friendly Energy** | |
| **Solar power** is a clean, renewable energy source that doesn’t produce harmful greenhouse gas emissions. By installing solar panels, you’re taking a step towards reducing your carbon footprint and contributing to a healthier planet. | |
| ### **3. Energy Independence** | |
| With solar panels , you can generate your own energy and reduce dependency on external suppliers. This protects you from rising energy prices and ensures a reliable power source, even in times of high demand. | |
| ### **4. Increased Property Value** | |
| Homes and businesses with solar panels are often more attractive to buyers due to their energy efficiency and lower running costs. This added value can make solar panels a smart investment for property owners. | |
| ### **5. Minimal Maintenance Requirements** | |
| Solar panels are designed to last for decades with minimal maintenance. Regular cleaning and occasional professional checks are typically enough to keep them running efficiently, making them a hassle-free energy solution. | |
| ### **6. Access to Incentives** | |
| Many governments offer incentives, grants, or tax breaks to encourage the adoption of solar energy. These schemes can significantly reduce the upfront costs of installation, making [solar panels](https://allsolarworks.com/solar/) more accessible than ever before. | |
| ## **How Do Solar Panels Work?** | |
| Solar panels are made of photovoltaic (PV) cells that convert sunlight into electricity. Here’s a simplified overview: | |
| 1. **Sunlight Absorption**: The PV cells capture sunlight and generate direct current (DC) electricity. | |
| 2. **Conversion to Usable Power**: An inverter converts the DC electricity into alternating current (AC), which powers your appliances. | |
| 3. **Energy Storage or Export**: Any excess energy can be stored in batteries or exported to the grid, providing additional financial benefits. | |
| ## **Why Switch to Solar Panels Now?** | |
| The shift towards renewable energy sources has made solar technology more affordable and efficient. With the rising costs of traditional energy, there’s never been a better time to [invest in solar panels](https://allsolarworks.com/solar/). Modern panels can generate electricity even in less sunny climates, ensuring reliable performance year-round. | |
| ## **Why Choose All Solar Works?** | |
| At All Solar Works, we specialise in providing tailored solar solutions that meet your unique energy needs. Here’s why you should choose us: | |
| - **Expert Installation**: Our team has extensive experience in designing and installing high-quality solar systems. | |
| - **Top-Tier Products**: We use only the best solar panels and components to ensure long-lasting performance. | |
| - **Comprehensive Support**: From initial consultation to ongoing maintenance, we’re here to support you every step of the way. | |
| [GET IN TOUCH](https://allsolarworks.com/contact-us/) | |
| ## **Ready to Embrace Solar Energy?** | |
| Solar panels are an investment in a brighter, greener future. If you’re ready to experience the **benefits of solar energy** today. Our experts are on hand to answer your questions and help you find the perfect solar solution for your property | |
| **Blog Content:** | |
| ```{blog}``` | |
| **Company Information:** | |
| ```{company_information}``` | |
| **Contact Us Page Link:** | |
| ```{link}``` | |
| """) | |
| def marketed_blog(llm, state): | |
| blog = state["blog_content"] | |
| url = state["contact_us_url"] | |
| company = state["company_information"] | |
| print(url) | |
| prompt = marketing_prompt_template.invoke({"company_information": company, "link": url, "blog":blog}) | |
| response = llm.invoke(prompt) | |
| print(response.content) | |
| return {"company_marketed_blog": response.content} | |