import streamlit as st import os from langchain_core.prompts import ChatPromptTemplate from langchain_huggingface import HuggingFaceEndpoint, ChatHuggingFace from langchain_core.messages import AIMessage, HumanMessage, SystemMessage os.environ["HUGGINGFACEHUB_API_KEY"] = os.getenv("HF") os.environ["HF_TOKEN"] = os.getenv("HF") model = HuggingFaceEndpoint( repo_id="meta-llama/Llama-3.2-3B-Instruct", provider="novita", temperature=0.6, max_new_tokens=300, task="conversational" ) llama_model = ChatHuggingFace( llm=model, repo_id="meta-llama/Llama-3.2-3B-Instruct", provider="novita", temperature=0.6, max_new_tokens=300, task="conversational" ) # session message history if "message_history" not in st.session_state: st.session_state.message_history = [ SystemMessage(content=""" You are an expert career advisor specializing in analyzing job descriptions and providing actionable insights to help job seekers tailor their resumes and skills for maximum impact. Given a Job Description, extract and present the following sections using markdown formatting: **1. Key Technical Skills** List the main technical skills required using bullet points. **2. Important Soft Skills** List the soft skills emphasized by the employer using bullet points. **3. Suggested Mini Projects** Recommend mini projects or learning paths to strengthen the candidate’s profile, using bullet points. **4. Resume Improvement Tips** Provide practical and specific tips to improve the candidate's resume, using bullet points. Use **bold headings** for each section and markdown bullet points (`- `). Write in a professional yet friendly tone. Be concise, clear, and focused on actionable advice. """) ] st.set_page_config(page_title="Smart JD Analyzer", page_icon="🧠", layout="wide") st.markdown(""" """, unsafe_allow_html=True) st.markdown('