Spaces:
Sleeping
Sleeping
Commit ·
76b5430
1
Parent(s): 2019c32
made changes
Browse files- Code+Folder/src/constants.py +22 -3
- Code+Folder/src/resume_suggestions.py +19 -10
- app.py +19 -10
- pyproject.toml +1 -2
- requirements.txt +1 -2
Code+Folder/src/constants.py
CHANGED
|
@@ -6,7 +6,28 @@ OUTPUT_PATH = "./output/"
|
|
| 6 |
JD_EMBEDDINGS_FILENAME = "jd_embeddings_large.pkl"
|
| 7 |
RESUME_EMBEDDINGS_FILENAME = "resume_embeddings_large.pkl"
|
| 8 |
IS_EMBEDDINGS_CREATED = True
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
TEMPLATE_CONTENT = """You are a helpful assistant. You do not respond as 'User' or pretend to be 'User'. You only
|
| 11 |
respond once as 'assistant'.
|
| 12 |
|
|
@@ -37,5 +58,3 @@ relevant_skills_highlight_prompt = "Analyze this resume: <RESUME STARTS HERE> {}
|
|
| 37 |
resume_formatting_prompt = "Offer guidance on how the candidate can enhance the formatting of their resume: <RESUME STARTS HERE> {} <RESUME ENDS HERE> to improve visual appeal and readability."
|
| 38 |
resume_length_prompt = "Recommend strategies for the candidate to adjust the length of their resume: <RESUME STARTS HERE> {} <RESUME ENDS HERE>, ensuring it is concise while remaining aligned with the requirements in the job description: <JOB DESCRIPTION STARTS HERE> {}. <JOB DESCRIPTION ENDS HERE>"
|
| 39 |
|
| 40 |
-
# OPENAI_API_KEY is used but not defined in this file
|
| 41 |
-
# OPENAI_API_KEY = "your-openai-api-key-here" # Replace with your actual API key
|
|
|
|
| 6 |
JD_EMBEDDINGS_FILENAME = "jd_embeddings_large.pkl"
|
| 7 |
RESUME_EMBEDDINGS_FILENAME = "resume_embeddings_large.pkl"
|
| 8 |
IS_EMBEDDINGS_CREATED = True
|
| 9 |
+
PROVIDERS = {
|
| 10 |
+
"OpenAI": {
|
| 11 |
+
"env_var": "OPENAI_API_KEY",
|
| 12 |
+
"models": ["gpt-4o", "gpt-4o-mini", "gpt-4.1", "gpt-4.1-mini"],
|
| 13 |
+
"url": "https://platform.openai.com/api-keys",
|
| 14 |
+
},
|
| 15 |
+
"xAI": {
|
| 16 |
+
"env_var": "XAI_API_KEY",
|
| 17 |
+
"models": ["xai/grok-2-latest", "xai/grok-2-mini"],
|
| 18 |
+
"url": "https://console.x.ai/",
|
| 19 |
+
},
|
| 20 |
+
"Anthropic": {
|
| 21 |
+
"env_var": "ANTHROPIC_API_KEY",
|
| 22 |
+
"models": ["anthropic/claude-sonnet-4-5-20250929", "anthropic/claude-haiku-4-5-20251001"],
|
| 23 |
+
"url": "https://console.anthropic.com/settings/keys",
|
| 24 |
+
},
|
| 25 |
+
"Google": {
|
| 26 |
+
"env_var": "GEMINI_API_KEY",
|
| 27 |
+
"models": ["gemini/gemini-2.0-flash", "gemini/gemini-2.5-flash-preview-04-17"],
|
| 28 |
+
"url": "https://aistudio.google.com/apikey",
|
| 29 |
+
},
|
| 30 |
+
}
|
| 31 |
TEMPLATE_CONTENT = """You are a helpful assistant. You do not respond as 'User' or pretend to be 'User'. You only
|
| 32 |
respond once as 'assistant'.
|
| 33 |
|
|
|
|
| 58 |
resume_formatting_prompt = "Offer guidance on how the candidate can enhance the formatting of their resume: <RESUME STARTS HERE> {} <RESUME ENDS HERE> to improve visual appeal and readability."
|
| 59 |
resume_length_prompt = "Recommend strategies for the candidate to adjust the length of their resume: <RESUME STARTS HERE> {} <RESUME ENDS HERE>, ensuring it is concise while remaining aligned with the requirements in the job description: <JOB DESCRIPTION STARTS HERE> {}. <JOB DESCRIPTION ENDS HERE>"
|
| 60 |
|
|
|
|
|
|
Code+Folder/src/resume_suggestions.py
CHANGED
|
@@ -16,8 +16,8 @@ from langchain_classic.chains import ConversationChain
|
|
| 16 |
from langchain_classic.memory import ConversationBufferWindowMemory
|
| 17 |
from langchain_core.messages import SystemMessage
|
| 18 |
from langchain_core.prompts import ChatPromptTemplate, HumanMessagePromptTemplate
|
| 19 |
-
from
|
| 20 |
-
from constants import
|
| 21 |
job_description_analysis_prompt, gap_analysis_prompt, actionable_steps_prompt, experience_enhancement_prompt, \
|
| 22 |
additional_qualifications_prompt, resume_tailoring_prompt, relevant_skills_highlight_prompt, \
|
| 23 |
resume_formatting_prompt, resume_length_prompt
|
|
@@ -38,17 +38,26 @@ with st.sidebar:
|
|
| 38 |
st.title('Resume Reviewer')
|
| 39 |
st.write("Upload your resume for my recommendations. Job description is optional.")
|
| 40 |
|
| 41 |
-
#
|
| 42 |
st.write("---")
|
| 43 |
-
st.write("###
|
| 44 |
-
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
if api_key:
|
| 48 |
-
os.environ[
|
| 49 |
-
llm =
|
| 50 |
else:
|
| 51 |
-
st.info("Please enter your
|
| 52 |
llm = None
|
| 53 |
|
| 54 |
# Resume upload (file only)
|
|
@@ -203,7 +212,7 @@ if llm is not None:
|
|
| 203 |
|
| 204 |
def generate_response(prompt_input):
|
| 205 |
if resume_chain is None:
|
| 206 |
-
return "Please enter your
|
| 207 |
output = resume_chain.predict(input=prompt_input)
|
| 208 |
return output
|
| 209 |
|
|
|
|
| 16 |
from langchain_classic.memory import ConversationBufferWindowMemory
|
| 17 |
from langchain_core.messages import SystemMessage
|
| 18 |
from langchain_core.prompts import ChatPromptTemplate, HumanMessagePromptTemplate
|
| 19 |
+
from langchain_community.chat_models import ChatLiteLLM
|
| 20 |
+
from constants import PROVIDERS, TEMPLATE_CONTENT, comparison_prompt, resume_analysis_prompt, \
|
| 21 |
job_description_analysis_prompt, gap_analysis_prompt, actionable_steps_prompt, experience_enhancement_prompt, \
|
| 22 |
additional_qualifications_prompt, resume_tailoring_prompt, relevant_skills_highlight_prompt, \
|
| 23 |
resume_formatting_prompt, resume_length_prompt
|
|
|
|
| 38 |
st.title('Resume Reviewer')
|
| 39 |
st.write("Upload your resume for my recommendations. Job description is optional.")
|
| 40 |
|
| 41 |
+
# Provider & Model selection
|
| 42 |
st.write("---")
|
| 43 |
+
st.write("### LLM Provider")
|
| 44 |
+
provider_names = list(PROVIDERS.keys())
|
| 45 |
+
selected_provider = st.selectbox("Provider", provider_names)
|
| 46 |
+
provider_info = PROVIDERS[selected_provider]
|
| 47 |
+
|
| 48 |
+
selected_model = st.selectbox("Model", provider_info["models"])
|
| 49 |
+
|
| 50 |
+
st.write(f"Get an API key at [{selected_provider}]({provider_info['url']})")
|
| 51 |
+
api_key = st.text_input(
|
| 52 |
+
f"{selected_provider} API Key", type="password",
|
| 53 |
+
help="Your API key will not be stored",
|
| 54 |
+
)
|
| 55 |
|
| 56 |
if api_key:
|
| 57 |
+
os.environ[provider_info["env_var"]] = api_key
|
| 58 |
+
llm = ChatLiteLLM(model=selected_model, temperature=0.0)
|
| 59 |
else:
|
| 60 |
+
st.info(f"Please enter your {selected_provider} API key to start")
|
| 61 |
llm = None
|
| 62 |
|
| 63 |
# Resume upload (file only)
|
|
|
|
| 212 |
|
| 213 |
def generate_response(prompt_input):
|
| 214 |
if resume_chain is None:
|
| 215 |
+
return "Please enter your API key to use this application"
|
| 216 |
output = resume_chain.predict(input=prompt_input)
|
| 217 |
return output
|
| 218 |
|
app.py
CHANGED
|
@@ -16,8 +16,8 @@ from langchain_classic.chains import ConversationChain
|
|
| 16 |
from langchain_classic.memory import ConversationBufferWindowMemory
|
| 17 |
from langchain_core.messages import SystemMessage
|
| 18 |
from langchain_core.prompts import ChatPromptTemplate, HumanMessagePromptTemplate
|
| 19 |
-
from
|
| 20 |
-
from constants import
|
| 21 |
job_description_analysis_prompt, gap_analysis_prompt, actionable_steps_prompt, experience_enhancement_prompt, \
|
| 22 |
additional_qualifications_prompt, resume_tailoring_prompt, relevant_skills_highlight_prompt, \
|
| 23 |
resume_formatting_prompt, resume_length_prompt
|
|
@@ -38,17 +38,26 @@ with st.sidebar:
|
|
| 38 |
st.title('Resume Reviewer')
|
| 39 |
st.write("Upload your resume for my recommendations. Job description is optional.")
|
| 40 |
|
| 41 |
-
#
|
| 42 |
st.write("---")
|
| 43 |
-
st.write("###
|
| 44 |
-
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
if api_key:
|
| 48 |
-
os.environ[
|
| 49 |
-
llm =
|
| 50 |
else:
|
| 51 |
-
st.info("Please enter your
|
| 52 |
llm = None
|
| 53 |
|
| 54 |
# Resume upload (file only)
|
|
@@ -192,7 +201,7 @@ if llm is not None:
|
|
| 192 |
|
| 193 |
def generate_response(prompt_input):
|
| 194 |
if resume_chain is None:
|
| 195 |
-
return "Please enter your
|
| 196 |
output = resume_chain.predict(input=prompt_input)
|
| 197 |
return output
|
| 198 |
|
|
|
|
| 16 |
from langchain_classic.memory import ConversationBufferWindowMemory
|
| 17 |
from langchain_core.messages import SystemMessage
|
| 18 |
from langchain_core.prompts import ChatPromptTemplate, HumanMessagePromptTemplate
|
| 19 |
+
from langchain_community.chat_models import ChatLiteLLM
|
| 20 |
+
from constants import PROVIDERS, TEMPLATE_CONTENT, comparison_prompt, resume_analysis_prompt, \
|
| 21 |
job_description_analysis_prompt, gap_analysis_prompt, actionable_steps_prompt, experience_enhancement_prompt, \
|
| 22 |
additional_qualifications_prompt, resume_tailoring_prompt, relevant_skills_highlight_prompt, \
|
| 23 |
resume_formatting_prompt, resume_length_prompt
|
|
|
|
| 38 |
st.title('Resume Reviewer')
|
| 39 |
st.write("Upload your resume for my recommendations. Job description is optional.")
|
| 40 |
|
| 41 |
+
# Provider & Model selection
|
| 42 |
st.write("---")
|
| 43 |
+
st.write("### LLM Provider")
|
| 44 |
+
provider_names = list(PROVIDERS.keys())
|
| 45 |
+
selected_provider = st.selectbox("Provider", provider_names)
|
| 46 |
+
provider_info = PROVIDERS[selected_provider]
|
| 47 |
+
|
| 48 |
+
selected_model = st.selectbox("Model", provider_info["models"])
|
| 49 |
+
|
| 50 |
+
st.write(f"Get an API key at [{selected_provider}]({provider_info['url']})")
|
| 51 |
+
api_key = st.text_input(
|
| 52 |
+
f"{selected_provider} API Key", type="password",
|
| 53 |
+
help="Your API key will not be stored",
|
| 54 |
+
)
|
| 55 |
|
| 56 |
if api_key:
|
| 57 |
+
os.environ[provider_info["env_var"]] = api_key
|
| 58 |
+
llm = ChatLiteLLM(model=selected_model, temperature=0.0)
|
| 59 |
else:
|
| 60 |
+
st.info(f"Please enter your {selected_provider} API key to start")
|
| 61 |
llm = None
|
| 62 |
|
| 63 |
# Resume upload (file only)
|
|
|
|
| 201 |
|
| 202 |
def generate_response(prompt_input):
|
| 203 |
if resume_chain is None:
|
| 204 |
+
return "Please enter your API key to use this application"
|
| 205 |
output = resume_chain.predict(input=prompt_input)
|
| 206 |
return output
|
| 207 |
|
pyproject.toml
CHANGED
|
@@ -9,8 +9,7 @@ dependencies = [
|
|
| 9 |
"langchain>=0.3.0",
|
| 10 |
"langchain-community>=0.3.0",
|
| 11 |
"langchain-core>=0.3.0",
|
| 12 |
-
"
|
| 13 |
-
"openai>=1.10.0",
|
| 14 |
"streamlit-feedback>=0.1.3",
|
| 15 |
"PyPDF2>=3.0.1",
|
| 16 |
"pypdf>=3.17.1",
|
|
|
|
| 9 |
"langchain>=0.3.0",
|
| 10 |
"langchain-community>=0.3.0",
|
| 11 |
"langchain-core>=0.3.0",
|
| 12 |
+
"litellm>=1.0.0",
|
|
|
|
| 13 |
"streamlit-feedback>=0.1.3",
|
| 14 |
"PyPDF2>=3.0.1",
|
| 15 |
"pypdf>=3.17.1",
|
requirements.txt
CHANGED
|
@@ -3,8 +3,7 @@ langchain>=0.3.0
|
|
| 3 |
langchain-classic>=1.0.0
|
| 4 |
langchain-community>=0.3.0
|
| 5 |
langchain-core>=0.3.0
|
| 6 |
-
|
| 7 |
-
openai>=1.10.0
|
| 8 |
streamlit-feedback>=0.1.3
|
| 9 |
PyPDF2>=3.0.1
|
| 10 |
pypdf>=3.17.1
|
|
|
|
| 3 |
langchain-classic>=1.0.0
|
| 4 |
langchain-community>=0.3.0
|
| 5 |
langchain-core>=0.3.0
|
| 6 |
+
litellm>=1.0.0
|
|
|
|
| 7 |
streamlit-feedback>=0.1.3
|
| 8 |
PyPDF2>=3.0.1
|
| 9 |
pypdf>=3.17.1
|