Spaces:
Sleeping
Sleeping
File size: 3,149 Bytes
3609d31 d2542d6 3609d31 d2542d6 3609d31 d2542d6 6376e52 d2542d6 |
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
import gradio as gr
from agent import HiringAgent
# Initialize the hiring agent
hiring_agent = HiringAgent()
def analyze_candidate(resume_url, github_url, job_description, company_info):
try:
result = hiring_agent.analyze_candidate(resume_url, github_url, job_description, company_info)
return result['assessment']
except Exception as e:
return f"Error analyzing candidate: {str(e)}"
# Create a simple Gradio Interface
with gr.Blocks(theme=gr.themes.Soft()) as app:
gr.Markdown("""
# π€ AgentPro Hiring Assistant
Upload candidate details and get a detailed assessment for your hiring process.
""")
with gr.Row():
with gr.Column(scale=1):
gr.Markdown("### π Candidate Information")
resume_url = gr.Textbox(
label="Resume URL",
placeholder="Enter Google Drive URL of the resume",
info="Paste the Google Drive URL of the candidate's resume"
)
github_url = gr.Textbox(
label="GitHub Profile",
placeholder="Enter GitHub profile URL",
info="Paste the candidate's GitHub profile URL"
)
gr.Markdown("### π’ Job & Company Details")
job_description = gr.Textbox(
label="Job Description",
placeholder="Enter the job description",
lines=5,
info="Describe the role and requirements"
)
company_info = gr.Textbox(
label="Company Information",
placeholder="Enter company details and culture",
lines=3,
info="Describe the company culture and environment"
)
analyze_btn = gr.Button("Analyze Candidate", variant="primary")
with gr.Column(scale=2):
gr.Markdown("### π Assessment Results")
output = gr.Markdown()
# Add example inputs
gr.Markdown("### π‘ Example Inputs")
gr.Examples(
examples=[
[
"https://drive.google.com/example-resume.pdf",
"https://github.com/example-user",
"Looking for a Senior Python Developer with 5+ years of experience in web development, machine learning, and cloud technologies. Must have strong problem-solving skills and experience with agile methodologies.",
"Tech startup focused on AI solutions, fast-paced environment, collaborative culture, emphasis on innovation and continuous learning."
]
],
inputs=[resume_url, github_url, job_description, company_info],
outputs=[output],
fn=analyze_candidate,
cache_examples=True
)
# Add footer
gr.Markdown("""
---
*Powered by AgentPro - An AI-powered hiring assistant*
""")
# Connect the analyze button
analyze_btn.click(
fn=analyze_candidate,
inputs=[resume_url, github_url, job_description, company_info],
outputs=[output]
)
# Launch the app
app.launch(share=True)
|