Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,6 @@ import queue
|
|
15 |
from langchain_openai import ChatOpenAI
|
16 |
from typing import List, Dict, Optional
|
17 |
from pydantic import BaseModel, Field, confloat
|
18 |
-
from langchain_groq import ChatGroq # Import Groq LLM
|
19 |
|
20 |
class SkillScore(BaseModel):
|
21 |
skill_name: str = Field(description="Name of the skill being scored")
|
@@ -232,7 +231,6 @@ class CompanyResearch(BaseModel):
|
|
232 |
interview_questions: List[str] = Field(
|
233 |
description="Strategic questions to ask during the interview"
|
234 |
)
|
235 |
-
llm = ChatGroq(model="groq/llama3-70b-8192", groq_api_key=groq_api_key)
|
236 |
|
237 |
resume_analyzer = Agent(
|
238 |
role= "Resume Optimization Expert",
|
@@ -243,7 +241,6 @@ resume_analyzer = Agent(
|
|
243 |
providing actionable suggestions for improvement. Your recommendations always
|
244 |
focus on both human readability and ATS compatibility.""",
|
245 |
verbose=True,
|
246 |
-
llm=llm,
|
247 |
# knowledge_sources=[pdf_source],
|
248 |
)
|
249 |
job_analyzer = Agent(
|
@@ -256,7 +253,6 @@ job_analyzer = Agent(
|
|
256 |
and soft skills requirements, and can evaluate experience levels accurately.""",
|
257 |
verbose=True,
|
258 |
tools=[ScrapeWebsiteTool()],
|
259 |
-
llm=llm,
|
260 |
# knowledge_sources=[pdf_source],
|
261 |
)
|
262 |
company_researcher = Agent(
|
@@ -269,7 +265,6 @@ company_researcher = Agent(
|
|
269 |
candidates for interviews. """,
|
270 |
tools=[SerperDevTool()],
|
271 |
verbose=True,
|
272 |
-
llm=llm,
|
273 |
# knowledge_sources=[pdf_source],
|
274 |
|
275 |
)
|
@@ -282,7 +277,6 @@ resume_writer = Agent (
|
|
282 |
beautifully formatted, ATS-friendly documents that maintain professionalism
|
283 |
while showcasing candidate strengths effectively.""",
|
284 |
verbose=True,
|
285 |
-
llm=llm,
|
286 |
)
|
287 |
report_generator = Agent(
|
288 |
role= "Career Report Generator and Markdown Specialist",
|
@@ -294,7 +288,6 @@ report_generator = Agent(
|
|
294 |
into clear, actionable insights with proper markdown formatting, emojis, and
|
295 |
visual elements that make information both appealing and easily digestible.""",
|
296 |
verbose=True,
|
297 |
-
llm=llm,
|
298 |
)
|
299 |
|
300 |
analyze_job_task = Task(
|
@@ -490,7 +483,7 @@ def run_crew(api_key: str, job_url: str, company_name: str, resume_pdf_path: str
|
|
490 |
if not api_key:
|
491 |
return "β οΈ Please provide a valid OpenAI API Key."
|
492 |
|
493 |
-
os.environ["
|
494 |
|
495 |
# Load PDF as knowledge source
|
496 |
# pdf_source = resume_pdf_path
|
@@ -573,7 +566,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
573 |
gr.Markdown("# π€ AI Resume Optimizer π")
|
574 |
gr.Markdown("Get Complete analysis of your resume")
|
575 |
|
576 |
-
api_key = gr.Textbox(label="π
|
577 |
job_url = gr.Textbox(label="π Job URL", placeholder="Paste job listing URL here")
|
578 |
company_name = gr.Textbox(label="π’ Company Name", placeholder="Enter company name")
|
579 |
resume_pdf = gr.File(label="π Upload Resume (PDF Only)")
|
|
|
15 |
from langchain_openai import ChatOpenAI
|
16 |
from typing import List, Dict, Optional
|
17 |
from pydantic import BaseModel, Field, confloat
|
|
|
18 |
|
19 |
class SkillScore(BaseModel):
|
20 |
skill_name: str = Field(description="Name of the skill being scored")
|
|
|
231 |
interview_questions: List[str] = Field(
|
232 |
description="Strategic questions to ask during the interview"
|
233 |
)
|
|
|
234 |
|
235 |
resume_analyzer = Agent(
|
236 |
role= "Resume Optimization Expert",
|
|
|
241 |
providing actionable suggestions for improvement. Your recommendations always
|
242 |
focus on both human readability and ATS compatibility.""",
|
243 |
verbose=True,
|
|
|
244 |
# knowledge_sources=[pdf_source],
|
245 |
)
|
246 |
job_analyzer = Agent(
|
|
|
253 |
and soft skills requirements, and can evaluate experience levels accurately.""",
|
254 |
verbose=True,
|
255 |
tools=[ScrapeWebsiteTool()],
|
|
|
256 |
# knowledge_sources=[pdf_source],
|
257 |
)
|
258 |
company_researcher = Agent(
|
|
|
265 |
candidates for interviews. """,
|
266 |
tools=[SerperDevTool()],
|
267 |
verbose=True,
|
|
|
268 |
# knowledge_sources=[pdf_source],
|
269 |
|
270 |
)
|
|
|
277 |
beautifully formatted, ATS-friendly documents that maintain professionalism
|
278 |
while showcasing candidate strengths effectively.""",
|
279 |
verbose=True,
|
|
|
280 |
)
|
281 |
report_generator = Agent(
|
282 |
role= "Career Report Generator and Markdown Specialist",
|
|
|
288 |
into clear, actionable insights with proper markdown formatting, emojis, and
|
289 |
visual elements that make information both appealing and easily digestible.""",
|
290 |
verbose=True,
|
|
|
291 |
)
|
292 |
|
293 |
analyze_job_task = Task(
|
|
|
483 |
if not api_key:
|
484 |
return "β οΈ Please provide a valid OpenAI API Key."
|
485 |
|
486 |
+
os.environ["OPENAI_API_KEY"] = f"{api_key}" # Set API key securely
|
487 |
|
488 |
# Load PDF as knowledge source
|
489 |
# pdf_source = resume_pdf_path
|
|
|
566 |
gr.Markdown("# π€ AI Resume Optimizer π")
|
567 |
gr.Markdown("Get Complete analysis of your resume")
|
568 |
|
569 |
+
api_key = gr.Textbox(label="π Open AI API Key", placeholder="Enter your OpenAI API Key securely")
|
570 |
job_url = gr.Textbox(label="π Job URL", placeholder="Paste job listing URL here")
|
571 |
company_name = gr.Textbox(label="π’ Company Name", placeholder="Enter company name")
|
572 |
resume_pdf = gr.File(label="π Upload Resume (PDF Only)")
|