DEV Community

Cover image for Elevate Your Content Strategy with Lyzr's Content Campaign Generator
Prajjwal Sule
Prajjwal Sule

Posted on

Elevate Your Content Strategy with Lyzr's Content Campaign Generator

Crafting compelling content campaigns is essential for enhancing brand visibility and engagement in today's digital landscape. To streamline this process, Lyzr introduces the Content Campaign Generator, a powerful tool designed to create comprehensive content roadmaps tailored to your business goals and target audience. In this article, we'll explore how this innovative tool simplifies the content planning process and empowers digital marketers to drive success. This utilizes Lyzr Automata to generate a 3–5 month content roadmap.

Lyzr offers an agent-centric approach to rapidly developing LLM (Large Language Model) applications with minimal code and time investment. Even if you’re unfamiliar with the GenAI stack, Lyzr empowers you to build your AI applications effortlessly. It is the go-to solution for constructing GenAI apps without requiring an in-depth understanding of Generative AI.


Welcome to Lyzr! | Lyzr Documentation

Explore the limitless possibilities of Generative AI with Lyzr, an enterprise alternative to popular Generative AI SaaS products. Lyzr offers a robust and secure solution for building and launching your own enterprise-grade Generative AI applications with speed and confidence.

favicon docs.lyzr.ai

Setting up the Project

Getting started with Lyzr's Content Campaign Generator is quick and easy. Follow these steps to set up the project:

Clone the App: Clone the Content Campaign Generator app repository from GitHub.

   git clone https://github.com/PrajjwalLyzr/Content-Campaign-Generator
Enter fullscreen mode Exit fullscreen mode

Create a Virtual Environment: Set up a virtual environment and activate it.

   python3 -m venv venv
   source venv/bin/activate
Enter fullscreen mode Exit fullscreen mode

Set Environment Variables: Create a .env file and add your OpenAI API key.

   OPENAI_API_KEY = "Paste your openai api key here"
Enter fullscreen mode Exit fullscreen mode

Install Dependencies: Install the required dependencies.

   pip install lyzr-automata streamlit python-dotenv
Enter fullscreen mode Exit fullscreen mode

Core Components of the Content Campaign Generator App

Let's explore the key components of Lyzr's Content Campaign Generator app:

import os
import streamlit as st
from lyzr_automata.ai_models.openai import OpenAIModel
from lyzr_automata import Agent, Task, Logger
from lyzr_automata.tasks.task_literals import InputType, OutputType
from lyzr_automata.pipelines.linear_sync_pipeline import LinearSyncPipeline
from dotenv import load_dotenv

load_dotenv()

API_KEY = os.getenv('OPENAI_API_KEY')

open_ai_model_text = OpenAIModel(
    api_key= API_KEY,
    parameters={
        "model": "gpt-4-turbo-preview",
        "temperature": 0.5,
        "max_tokens": 1500,
    },
)

def content_campaign_generator(campaign_goal, target_audience):

    digital_marketer_agent = Agent(
        prompt_persona="""You are an expert Digital Marketer and as a Digital Marketer expert, your mission is to craft and execute innovative digital marketing strategies that elevate brand visibility and drive customer engagement. Utilize your expertise in data analysis, SEO optimization, social media management, and content creation to create compelling campaigns that resonate with target audiences and propel brands to new heights in the digital landscape.""",
        role="Digital Marketer",
    )

    campaign_generator =  Task(
        name="Campaign Generator",
        agent=digital_marketer_agent,
        output_type=OutputType.TEXT,
        input_type=InputType.TEXT,
        model=open_ai_model_text,
        instructions=f"Use the description provided Outline a content roadmap with key topics and formats for a 5-month content marketing campaign, the Campaign Goal : {campaign_goal} for the Target Audience: {target_audience}. [IMPORTANT!] Setup the events in a detailed manner",
        log_output=True,
        enhance_prompt=False,
        default_input=campaign_goal
    )

    logger = Logger()

    main_output = LinearSyncPipeline(
        logger=logger,
        name="Content Campaign Generator",
        completion_message="App Generated all things!",
        tasks=[
            campaign_generator,
        ],
    ).run()

    return main_output
Enter fullscreen mode Exit fullscreen mode

Initializing the Application

The entry point of the Content Campaign Generator application prompts the user to input the campaign goal and target audience via Streamlit text areas. Upon clicking the submit button, it triggers the content_campaign_generator function, passing the provided campaign goal and target audience as parameters.

if __name__ == "__main__":
    campaign = st.text_area("Campaign Goal")
    audience = st.text_area('Targeted Audience')

    button = st.button('Submit')
    if button:
        generated_output = content_campaign_generator(campaign_goal=campaign, target_audience=audience)
        title_output = generated_output[0]['task_output']
        st.write(title_output)
        st.markdown('---')
Enter fullscreen mode Exit fullscreen mode

The function generates a content roadmap based on the inputs, outlining key topics and formats for a 5-month content marketing campaign tailored to the specified audience.

Conclusion

Lyzr's Content Campaign Generator, digital marketers can streamline the content planning process and craft innovative content strategies that elevate brand visibility and drive engagement. Embrace the power of AI to create comprehensive content roadmaps tailored to your business goals and target audience.

References

Top comments (0)