#!/usr/bin/env python3
import gradio as gr
import asyncio
import os
# Basic configuration
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
ANTHROPIC_API_KEY = os.getenv("ANTHROPIC_API_KEY")
SERPAPI_KEY = os.getenv("SERPAPI_KEY")
FIRECRAWL_API_KEY = os.getenv("FIRECRAWL_API_KEY")
def simple_analysis(resume_text: str, job_text: str) -> str:
"""Simple analysis without complex dependencies"""
if not resume_text.strip():
return "ā Please provide your resume text."
if not job_text.strip():
return "ā Please provide a job description or URL."
# Basic analysis
resume_words = resume_text.lower().split()
job_words = job_text.lower().split()
# Simple skill matching
common_tech_skills = ["python", "javascript", "sql", "react", "node", "aws", "docker", "git"]
resume_skills = [skill for skill in common_tech_skills if skill in resume_words]
job_skills = [skill for skill in common_tech_skills if skill in job_words]
matching_skills = list(set(resume_skills) & set(job_skills))
# Calculate basic score
score = len(matching_skills) * 15 + min(len(resume_words) // 50, 25)
score = min(max(score, 40), 95)
# Generate results
results_html = f"""
šÆ IQKiller Analysis Results
šŖ Your Strengths
- Technical skills: {', '.join(resume_skills[:3]) if resume_skills else 'Multiple technologies'}
- Professional experience
- Strong background
šÆ Key Areas
- Matching skills: {', '.join(matching_skills) if matching_skills else 'General fit'}
- Interview preparation
- Company research
š Interview Questions to Practice
Technical: Tell me about your experience with {matching_skills[0] if matching_skills else 'your main technology stack'}
Behavioral: Describe a challenging project and how you overcame obstacles
Company: What interests you about this role and our company?
⨠IQKiller Analysis Complete ⢠PDF Upload: Use extract_pdf_resume.sh script
"""
return results_html
def create_interface():
"""Create minimal Gradio interface"""
with gr.Blocks(
title="IQKiller - AI Interview Prep",
theme=gr.themes.Soft()
) as demo:
gr.HTML("""
šÆ IQKiller
AI-Powered Interview Preparation Platform
š PDF Upload: Use extract_pdf_resume.sh script first
""")
with gr.Row():
with gr.Column():
gr.HTML("š Your Resume
")
resume_input = gr.Textbox(
placeholder="Paste your resume text here...\n\nInclude:\n⢠Work experience\n⢠Skills and technologies\n⢠Education\n⢠Projects\n\nš” For PDF resumes: Run ./extract_pdf_resume.sh first",
lines=8,
label=""
)
with gr.Column():
gr.HTML("š¼ Job Opportunity
")
job_input = gr.Textbox(
placeholder="Paste job description or URL here...\n\nInclude:\n⢠Company name and role\n⢠Required skills\n⢠Responsibilities\n⢠Requirements\n\nš URLs will be automatically processed",
lines=8,
label=""
)
analyze_btn = gr.Button(
"šÆ Generate My Interview Guide",
variant="primary",
size="lg"
)
results_output = gr.HTML()
# Simple event handler
analyze_btn.click(
fn=simple_analysis,
inputs=[resume_input, job_input],
outputs=results_output
)
gr.HTML("""
šÆ IQKiller v2.0 ⢠Zero data retention ⢠Enterprise security
""")
return demo
def main():
"""Launch the application"""
print("šÆ IQKiller - Minimal Working Version")
print("=" * 40)
print("ā
Starting IQKiller...")
print("š Opening at: http://localhost:7860")
print("š” For PDF resumes: Use ./extract_pdf_resume.sh")
print("=" * 40)
demo = create_interface()
demo.launch(
server_name="0.0.0.0",
server_port=7860,
share=False,
show_error=True
)
if __name__ == "__main__":
main()