namann007 commited on
Commit
28e4bb0
1 Parent(s): 8385b42

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -0
app.py ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from langchain_google_genai import ChatGoogleGenerativeAI
3
+
4
+ st.title("Software Skills to Job Recommendations Bot")
5
+
6
+ def get_job_recommendations(software_skills):
7
+ prompt = (
8
+ f"Based on the following software skills: {software_skills}, "
9
+ "suggest suitable jobs that the person can apply for. Provide a brief description of each job."
10
+ )
11
+
12
+ llm = ChatGoogleGenerativeAI(model="gemini-pro", google_api_key=st.secrets["GOOGLE_API_KEY"])
13
+ response = llm.invoke(prompt)
14
+
15
+ recommendations = response.content
16
+ return recommendations
17
+
18
+ with st.form("job_form"):
19
+ software_skills = st.text_area("Enter the software skills you know")
20
+ submitted = st.form_submit_button("Get Job Recommendations")
21
+
22
+ if submitted:
23
+ if software_skills:
24
+ job_recommendations = get_job_recommendations(software_skills)
25
+ if job_recommendations:
26
+ st.info(job_recommendations)
27
+ else:
28
+ st.error("Failed to retrieve job recommendations.")
29
+ else:
30
+ st.error("Please enter your software skills to get job recommendations.")