File size: 505 Bytes
f3f0a69
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import requests
import json
from config import HUGGINGFACE_API_URL, HUGGINGFACE_API_KEY

HEADERS = {"Authorization": f"Bearer {HUGGINGFACE_API_KEY}"}

def analyze_resume(text):
    """Send resume text to Google Gemini model via Hugging Face API."""
    data = {"inputs": text}
    response = requests.post(HUGGINGFACE_API_URL, headers=HEADERS, data=json.dumps(data))
    if response.status_code == 200:
        return response.json()["output"]
    return {"score": 0, "summary": "Error processing resume"}