-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makker.py
146 lines (126 loc) · 5.78 KB
/
Makker.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import streamlit as st
import numpy as np
import pandas as pd
import time
from streamlit_option_menu import option_menu
from API import generateBio, writeShorter, generateCL
#Navbar assignment
selected = option_menu(
menu_title=None,
options=['LinkedIn Bio', 'Cover Letter'],
icons=["blockquote-left", "envelope"],
menu_icon="cast",
default_index=0,
orientation="horizontal"
)
with st.sidebar:
st.title('Meet Makker 👋👋')
st.image('https://i.imgur.com/UCMEUwo.png', width=200)
st.subheader("MakkerAI is your personal AI assistant for writing bios and cover letters. Project for Build your AI Startup Hackathon Episode 2")
code ='''hackathonParticipants =[
Arianit Sylafeta,
Manuel Palazzo,
Jose Campo,
Saira Asghar,
Bright Boakye
]'''
st.code(code)
#Main pages
if selected =="LinkedIn Bio":
st.title("AI LinkedIn Bio Generator 🚀")
st.write("")
#Seperate containers into columns
left = st.container()
right = st.container()
left, right = st.columns([1,5])
def pushcontainers():
left.write('')
left.write('')
left.write('')
right.write('')
right.write('')
left.image('https://i.imgur.com/H4f9t8E.png')
right.subheader("I've got the perfect idea for a bio. Please tell me what tone of voice do you want to use?💭")
tov = right.selectbox("Please input the tone of voice you want?", ('...','Professional', 'Informal', 'Enthusiastic', 'Neutral', 'Other'))
#If you want to have all input fields showing all the time just remove the if statements and make them the same identation.
if tov != '...':
if tov == 'Other':
left.write('')
left.write('')
left.write('')
left.write('')
tov = right.text_input('Please specify?')
pushcontainers()
left.write('')
left.write('')
left.image('https://i.imgur.com/T13MHNK.png')
right.subheader('Great, now I will need some general information to work with.👤')
info = right.text_input("Full Name, Education, Work Experience...")
if info:
pushcontainers()
left.image('https://i.imgur.com/pgHUU2X.png')
right.subheader('Nearly done, any sample bio you want to mimic?🔎')
left.write('')
sample = right.text_input("LinkedIn bio you like.(Type 'N' for none)")
if sample:
pushcontainers()
left.image('https://i.imgur.com/MK73xxW.png')
right.subheader('Last one, anything you want to emphasize?❗')
emphasize = right.text_input('Skill or characteristic you want to emphasize')
if emphasize:
tov = "tone of voice: " + tov + "\n"
info ="personal info:" + info + "\n"
sample = "sample: " + sample + "\n"
emphasize = "traits to emphasize: " + emphasize + "\n"
list = [tov, info, sample, emphasize]
response = generateBio(list)
left.write('')
right.write('')
right.write('')
right.write('')
left.image('https://i.imgur.com/tKBSrKn.png')
right.subheader("🎈Yuhuu we made it. Here's your LinkedIn Bio🎈")
right.markdown(response)
if selected =="Cover Letter":
st.title("AI Cover Letter Generator🚀")
with st.form(key='my_form_to_submit'):
st.subheader('Your Personal Information')
col1,col2 = st.columns(2)
first_name = col1.text_input("👤FIRST NAME: ", placeholder="John")
last_name = col2.text_input("👤LAST NAME: ", placeholder="Doe")
col1,col2,col3 = st.columns(3)
email = col1.text_input("📧EMAIL ADDRESS ", placeholder="Johndoe@gmail.com")
desired_pos = col2.text_input("👨DESIRED POSITION", placeholder="Data Scientist")
experience = col3.number_input('💻YEARS of EXPERIENCE', 0, 25)
skills = col1.text_input('💪 SKILLS:', placeholder='Python')
experience_level = col2.select_slider('EXPERIENCE LEVEL ', ['Fresh','Internee','Entry-Level', 'Junior', 'Senior'])
achievements = col3.text_input('🌟 ACHIEVEMENTS:', placeholder='Employee of the month')
st.subheader('Company Information')
col1, col2, col3 = st.columns(3)
company_name = col1.text_input('🏢 COMPANY NAME:', placeholder='Company')
company_representative = col2.text_input('👨💼 COMPANY REPRESENTATIVE:', placeholder='Jane Doe')
company_email = col3.text_input("📧COMPANY EMAIL: ", placeholder="HR@company.com")
st.subheader('Cover Letter Specifics')
col1, col2 = st.columns(2)
option = col1.selectbox(
'💭SELECT TONE of VOICE',
("Authoritative","Caring","Funny","Cheerful","Coarse","Conservative","Conversational","Casual","Dry", "Other"))
if option == "Other":
option = col1.text_input('Please specify...')
goodfit = col2.text_input("Why are you a good fit for the job?", placeholder="Let Makker decide?(Leave Blank)")
st.write('')
st.write('')
submit_button = st.form_submit_button(label='GET COVER LETTER 🤖')
list=[first_name,last_name,email,desired_pos,experience,skills,experience_level,achievements,company_name,company_representative,company_email,goodfit]
list_for_check = list[:-1]
if submit_button and option and not ('' in list_for_check):
with st.spinner('Just a sec...'):
response = generateCL(list)
st.write('')
st.write('')
st.write('')
st.write('')
st.image('https://i.imgur.com/tKBSrKn.png')
st.subheader("🎈Yuhuu we made it. Here's your Cover Letter🎈")
st.markdown(response)
# prompt = ("Write a cover letter to " + contact_person + " from " + your_name +" for a " + role + " job at " + company_name +"." + " I have experience in " +personal_exp + " I am excited about the job because " +job_desc + " I am passionate about "+ passion)