Building LinkedIn Elevator Pitch Generator with Lyzr SDK
Tags: ai, opensource, pitch, linkedin
Published: 2024-04-29 03:45:24

In today’s competitive job market, crafting a compelling elevator pitch is essential for professionals looking to make a lasting impression. In this blog post, we’ll dive into the creation of a **LinkedIn Elevator Pitch Generator** using Streamlit, a popular Python framework for building web applications, and OpenAI’s powerful language model. By dissecting the code and understanding its components, we’ll explore how it generates personalized elevator pitches tailored to individual professional profiles.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u7svcc17r3ip1i3plvxi.png)

**Why use Lyzr SDK’s?**

With **Lyzr SDKs**, crafting your own **GenAI** application is a breeze, requiring only a few lines of code to get up and running swiftly.

[Checkout the Lyzr SDK’s](https://docs.lyzr.ai/homepage)

**Lets get Started!**

**Setting Up the Environment:** To start, let’s ensure we have all the necessary libraries installed. We’re using Streamlit for the web interface, Lyzr Automata for task automation, and PIL for image processing.

```
import streamlit as st
from lyzr_automata.ai_models.openai import OpenAIModel
from lyzr_automata import Agent, Task
from lyzr_automata.pipelines.linear_sync_pipeline import LinearSyncPipeline
from PIL import Image
import os
```

```
# Set the OpenAI API key
os.environ["OPENAI_API_KEY"] = st.secrets["apikey"]
```
**Designing the User Interface:** Now, let’s create a visually appealing interface using Streamlit. We’ll include an input field for users to enter their professional details and display the Lyzr Automata logo.

```
image = Image.open("./logo/lyzr-logo.png")
st.image(image, width=150)
```

```
# App title and introduction
st.title("LinkedIn Elevator Pitch Generator👨‍💻")
st.markdown("Welcome to the LinkedIn Elevator Pitch Generator! Craft a compelling elevator pitch tailored to your professional profile with expert guidance")
input = st.text_input("Please enter your name, professional role, experience, and any notable achievements. Feel free to include any other relevant details as well.",placeholder=f"""Type here""")
```
**Generating Elevator Pitches with OpenAI:** Let’s dive into the heart of our application — the generation of elevator pitches using OpenAI’s language model. Here’s how we prompt the model with instructions and user input to craft personalized pitches.

```
open_ai_text_completion_model = OpenAIModel(
    api_key=st.secrets["apikey"],
    parameters={
        "model": "gpt-4-turbo-preview",
        "temperature": 0.2,
        "max_tokens": 1500,
    },
)
def pitch_generation(input):
    generator_agent = Agent(
        role="LINKEDIN ELEVATOR PITCH expert",
        prompt_persona=f"Your task  is to CREATE a COMPELLING elevator pitch for the user, TAILORED to their provided details such as NAME, PROFESSIONAL ROLE, INDUSTRY, EXPERIENCE, KEY SKILLS, NOTABLE ACHIEVEMENTS, PASSIONS, and GOALS."
    )
    prompt = f"""
    [Prompt Text Here]
    """
    generator_agent_task = Task(
        name="Pitch Generation",
        model=open_ai_text_completion_model,
        agent=generator_agent,
        instructions=prompt,
        default_input=input,
        output_type=OutputType.TEXT,
        input_type=InputType.TEXT,
    ).execute()
    return generator_agent_task
```
**User Interaction and Output:** Once the user inputs their details, they can generate a personalized elevator pitch with the click of a button. Here’s how we handle user interaction and display the generated pitch.

```
if st.button("Generate!"):
    solution = pitch_generation(input)
    st.markdown(solution)
```
This blog post has provided a detailed exploration of the code behind a LinkedIn Elevator Pitch Generator built using **Streamlit** and **OpenAI**. By understanding the components and functionality of the application, professionals can leverage similar tools to enhance their networking efforts and create impactful elevator pitches tailored to their unique profiles.

Crafting a compelling **elevator pitch** isn’t just about succinctly summarizing your **professional journey** — it’s about shaping your personal brand and opening doors to new opportunities.

By harnessing the power of the LinkedIn Elevator Pitch Generator, professionals gain a strategic advantage in **networking, career advancement, and personal empowerment**, ensuring that every interaction is purposeful and memorable.

**App link:** https://elevatorpitch-lyzr.streamlit.app/

**Source Code:** https://github.com/isakshay007/Elevator_Pitch

**Connect with Lyzr**
To learn more about **Lyzr and its SDK’s**, visit our website or get in touch with our team:

**Website:** [Lyzr.ai](https://www.lyzr.ai/)
**Book a Demo:** [Book a Demo](https://www.lyzr.ai/book-demo/)
**Discord:** [Join our Discord community](https://discord.com/invite/nm7zSyEFA2)
**Slack:** [Join our Slack channel](https://anybodycanai.slack.com/join/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw#/shared-invite/email)