Twitter and LinkedIn Writers

This commit is contained in:
ajaysi
2025-04-16 16:23:42 +05:30
parent 036fde9e81
commit 5982ce558c
16 changed files with 1997 additions and 174 deletions

View File

@@ -31,31 +31,32 @@ async def linkedin_profile_optimizer_ui():
st.info("Upload your profile information for a comprehensive analysis")
# Profile Data Input
with st.expander("Enter Profile Information", expanded=True):
profile_data = {
"headline": st.text_input("Current Headline"),
"about": st.text_area("About Section"),
"industry": st.text_input("Industry"),
"current_role": st.text_input("Current Role"),
"experience": [],
"skills": st.text_area("Current Skills (one per line)").split("\n"),
"education": st.text_area("Education (one per line)").split("\n")
}
# Experience Input
st.subheader("Work Experience")
num_experiences = st.number_input("Number of experiences to add", min_value=0, max_value=10, value=1)
for i in range(num_experiences):
with st.expander(f"Experience {i+1}"):
exp = {
"role": st.text_input(f"Role {i+1}"),
"company": st.text_input(f"Company {i+1}"),
"description": st.text_area(f"Description {i+1}")
}
profile_data["experience"].append(exp)
st.subheader("Enter Profile Information")
profile_data = {
"headline": st.text_input("Current Headline", key="profile_headline"),
"about": st.text_area("About Section", key="profile_about"),
"industry": st.text_input("Industry", key="profile_industry"),
"current_role": st.text_input("Current Role", key="profile_role"),
"experience": [],
"skills": st.text_area("Current Skills (one per line)", key="profile_skills").split("\n"),
"education": st.text_area("Education (one per line)", key="profile_education").split("\n")
}
if st.button("Analyze Profile"):
# Experience Input
st.subheader("Work Experience")
num_experiences = st.number_input("Number of experiences to add", min_value=0, max_value=10, value=1, key="profile_num_exp")
for i in range(num_experiences):
st.markdown(f"**Experience {i+1}**")
exp = {
"role": st.text_input(f"Role {i+1}", key=f"profile_role_{i}"),
"company": st.text_input(f"Company {i+1}", key=f"profile_company_{i}"),
"description": st.text_area(f"Description {i+1}", key=f"profile_desc_{i}")
}
profile_data["experience"].append(exp)
st.divider()
if st.button("Analyze Profile", key="profile_analyze_btn"):
with st.spinner("Analyzing your profile..."):
analysis = await optimizer.analyze_profile_strength(profile_data)
@@ -83,11 +84,11 @@ async def linkedin_profile_optimizer_ui():
st.header("Headline Optimizer")
st.info("Optimize your headline for better visibility and impact")
current_headline = st.text_input("Current Headline")
industry = st.text_input("Industry")
role = st.text_input("Current/Target Role")
current_headline = st.text_input("Current Headline", key="headline_current")
industry = st.text_input("Industry", key="headline_industry")
role = st.text_input("Current/Target Role", key="headline_role")
if st.button("Optimize Headline"):
if st.button("Optimize Headline", key="headline_optimize_btn"):
with st.spinner("Generating optimized headline..."):
headline_optimization = await optimizer.optimize_headline(
current_headline,
@@ -110,11 +111,11 @@ async def linkedin_profile_optimizer_ui():
st.header("About Section Generator")
st.info("Create an engaging and professional About section")
current_about = st.text_area("Current About Section")
achievements = st.text_area("Key Achievements (one per line)").split("\n")
target_audience = st.text_input("Target Audience")
current_about = st.text_area("Current About Section", key="about_current")
achievements = st.text_area("Key Achievements (one per line)", key="about_achievements").split("\n")
target_audience = st.text_input("Target Audience", key="about_audience")
if st.button("Generate About Section"):
if st.button("Generate About Section", key="about_generate_btn"):
with st.spinner("Generating optimized About section..."):
about_optimization = await optimizer.generate_about_section(
current_about,
@@ -128,8 +129,9 @@ async def linkedin_profile_optimizer_ui():
st.subheader("Section Structure")
for section, explanation in about_optimization['structure_explanation'].items():
with st.expander(section):
st.write(explanation)
st.markdown(f"**{section}**")
st.write(explanation)
st.divider()
st.subheader("Impact Factors")
for factor in about_optimization['impact_factors']:
@@ -141,44 +143,47 @@ async def linkedin_profile_optimizer_ui():
st.info("Enhance your work experience descriptions for maximum impact")
experiences = []
num_exp = st.number_input("Number of experiences to enhance", min_value=1, max_value=10, value=1)
num_exp = st.number_input("Number of experiences to enhance", min_value=1, max_value=10, value=1, key="exp_num")
for i in range(num_exp):
with st.expander(f"Experience {i+1}"):
exp = {
"role": st.text_input(f"Role {i+1}"),
"company": st.text_input(f"Company {i+1}"),
"description": st.text_area(f"Current Description {i+1}")
}
experiences.append(exp)
st.markdown(f"**Experience {i+1}**")
exp = {
"role": st.text_input(f"Role {i+1}", key=f"exp_role_{i}"),
"company": st.text_input(f"Company {i+1}", key=f"exp_company_{i}"),
"description": st.text_area(f"Current Description {i+1}", key=f"exp_desc_{i}")
}
experiences.append(exp)
st.divider()
if st.button("Enhance Experiences"):
if st.button("Enhance Experiences", key="exp_enhance_btn"):
with st.spinner("Enhancing experience descriptions..."):
enhanced_experiences = await optimizer.enhance_experience_descriptions(experiences)
for i, exp in enumerate(enhanced_experiences):
with st.expander(f"Enhanced Experience {i+1}"):
st.subheader(f"{exp['role']} at {exp['company']}")
st.markdown(exp['enhanced_description'])
st.subheader("Key Achievements")
for achievement in exp['achievements']:
st.success(achievement)
st.subheader("Keywords Used")
for keyword in exp['keywords']:
st.info(keyword)
st.markdown(f"**Enhanced Experience {i+1}**")
st.subheader(f"{exp['role']} at {exp['company']}")
st.markdown(exp['enhanced_description'])
st.subheader("Key Achievements")
for achievement in exp['achievements']:
st.success(achievement)
st.subheader("Keywords Used")
for keyword in exp['keywords']:
st.info(keyword)
st.divider()
# Skills Recommender Tab
with tabs[4]:
st.header("Skills Recommender")
st.info("Get personalized skill recommendations for your profile")
current_skills = st.text_area("Current Skills (one per line)").split("\n")
industry = st.text_input("Industry (for skills)")
role = st.text_input("Role (for skills)")
current_skills = st.text_area("Current Skills (one per line)", key="skills_current").split("\n")
industry = st.text_input("Industry (for skills)", key="skills_industry")
role = st.text_input("Role (for skills)", key="skills_role")
if st.button("Get Skill Recommendations"):
if st.button("Get Skill Recommendations", key="skills_recommend_btn"):
with st.spinner("Analyzing and recommending skills..."):
skill_recommendations = await optimizer.recommend_skills(
current_skills,
@@ -204,6 +209,7 @@ async def linkedin_profile_optimizer_ui():
st.subheader("Skill Categories")
for category, skills in skill_recommendations['skill_categories'].items():
with st.expander(category):
for skill in skills:
st.write(f"- {skill}")
st.markdown(f"**{category}**")
for skill in skills:
st.write(f"- {skill}")
st.divider()