File size: 1,141 Bytes
28e4bb0
 
 
c65959d
28e4bb0
c65959d
28e4bb0
c65959d
 
28e4bb0
 
 
 
 
 
 
 
 
c65959d
 
28e4bb0
 
c65959d
 
 
 
28e4bb0
c65959d
28e4bb0
c65959d
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
import streamlit as st
from langchain_google_genai import ChatGoogleGenerativeAI

st.title("Job Role Skills Recommendation Bot")

def get_skills_recommendations(job_role):
    prompt = (
        f"For the job role of {job_role}, suggest the necessary software and skills that one should learn to excel in this role. "
        "Provide a detailed list of recommendations."
    )
    
    llm = ChatGoogleGenerativeAI(model="gemini-pro", google_api_key=st.secrets["GOOGLE_API_KEY"])
    response = llm.invoke(prompt)
    
    recommendations = response.content
    return recommendations

with st.form("job_form"):
    job_role = st.text_input("Enter the job role you want to apply for")
    submitted = st.form_submit_button("Get Skills Recommendations")
    
    if submitted:
        if job_role:
            skills_recommendations = get_skills_recommendations(job_role)
            if skills_recommendations:
                st.info(skills_recommendations)
            else:
                st.error("Failed to retrieve skills recommendations.")
        else:
            st.error("Please enter a job role to get skills recommendations.")