Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
GROQ_API_KEY=<your api key here>
GROQ_API_KEY=<<YOU NEED TO KEEP GROQ API KEY HERE>>
17 changes: 9 additions & 8 deletions app/chains.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ def write_mail(self, job, links):
{job_description}

### INSTRUCTION:
You are Mohan, a business development executive at AtliQ. AtliQ is an AI & Software Consulting company dedicated to facilitating
the seamless integration of business processes through automated tools.
Over our experience, we have empowered numerous enterprises with tailored solutions, fostering scalability,
process optimization, cost reduction, and heightened overall efficiency.
Your job is to write a cold email to the client regarding the job mentioned above describing the capability of AtliQ
in fulfilling their needs.
Also add the most relevant ones from the following links to showcase Atliq's portfolio: {link_list}
Remember you are Mohan, BDE at AtliQ.


You are Sowmya, an AI Engineer at Reliance Jio. Reliance Jio is a leader in technology solutions, dedicated to revolutionizing
industries with cutting-edge AI, ML, and Deep Learning models. Over your experience, you have empowered numerous enterprises
by implementing AI-driven solutions that foster scalability, process optimization, and enhanced decision-making capabilities.
Your job is to write a cold email to the client regarding the job mentioned above, describing your expertise in AI/ML, LLMs, and DL, and how your skill set can fulfill their needs.
Also, highlight your experience in integrating AI models across various enterprise environments for efficiency and cost optimization.
Also add the most relevant ones from the following links to showcase Jio's portfolio: {link_list}
Remember, you are Sowmya, AI Engineer at Reliance Jio.
Do not provide a preamble.
### EMAIL (NO PREAMBLE):

Expand Down
80 changes: 60 additions & 20 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,71 @@
from portfolio import Portfolio
from utils import clean_text


def create_streamlit_app(llm, portfolio, clean_text):
st.title("📧 Cold Mail Generator")
url_input = st.text_input("Enter a URL:", value="https://jobs.nike.com/job/R-33460")
submit_button = st.button("Submit")
st.set_page_config(layout="wide", page_title="Cold Mail Generator", page_icon="📧")

if submit_button:
try:
loader = WebBaseLoader([url_input])
data = clean_text(loader.load().pop().page_content)
portfolio.load_portfolio()
jobs = llm.extract_jobs(data)
for job in jobs:
skills = job.get('skills', [])
links = portfolio.query_links(skills)
email = llm.write_mail(job, links)
st.code(email, language='markdown')
except Exception as e:
st.error(f"An Error Occurred: {e}")
# Custom CSS for styling
st.markdown("""
<style>
.title {
color: #1E90FF;
font-size: 2em;
}
.subtitle {
color: #4682B4;
font-size: 1.5em;
}
.warning {
color: #FF6347;
}
.success {
color: #32CD32;
}
.sidebar .sidebar-content {
background-color: #F0F8FF;
}
</style>
""", unsafe_allow_html=True)

st.markdown('<p class="title">Cold Mail Generator for Job Descriptions</p>', unsafe_allow_html=True)
st.write("Hi, how are you! I can help to generate a Professional Email!")
st.write("Generate a tailored cold email based on the job description provided in the URL.")

st.sidebar.header("Input Window")
url_input = st.sidebar.text_input("Please Enter a URL:", value="URL please..!")
submit_button = st.sidebar.button("Generate Email")

if submit_button:
if url_input and url_input != "URL please..!":
try:
with st.spinner("Processing..."):
# Load and clean the job description
loader = WebBaseLoader([url_input])
raw_data = loader.load().pop().page_content
cleaned_data = clean_text(raw_data)

# Process the cleaned data and generate email
portfolio.load_portfolio()
jobs = llm.extract_jobs(cleaned_data)

if jobs:
for job in jobs:
skills = job.get('skills', [])
links = portfolio.query_links(skills)
email = llm.write_mail(job, links)

# Display the generated email
st.subheader("Generated Email")
st.code(email, language='markdown')
st.markdown('<p class="success">Email generated successfully!</p>', unsafe_allow_html=True)
else:
st.markdown('<p class="warning">No jobs found in the provided URL.</p>', unsafe_allow_html=True)
except Exception as e:
st.markdown(f'<p class="warning">An error occurred: {e}</p>', unsafe_allow_html=True)
else:
st.markdown('<p class="warning">Please enter a valid URL.</p>', unsafe_allow_html=True)

if __name__ == "__main__":
chain = Chain()
portfolio = Portfolio()
st.set_page_config(layout="wide", page_title="Cold Email Generator", page_icon="📧")
create_streamlit_app(chain, portfolio, clean_text)


Loading