Spaces:
Running
Running
File size: 1,138 Bytes
2600a8c |
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 |
from crewai import Crew, Agent, Task
from huggingface_hub import InferenceClient
import os
HF_API_URL = "https://api-inference.huggingface.co/models/YOUR_MODEL"
HF_API_KEY = "your_api_key"
client = InferenceClient(token=HF_API_KEY)
class ResumeAgents:
@staticmethod
def parse_resume(resume_text):
"""Agent to extract key resume details"""
prompt = f"Extract skills, experience, and education from this resume:\n{resume_text}"
response = client.text_generation(prompt)
return response
@staticmethod
def rank_resume(resume_details, job_description):
"""Agent to rank the resume against the job description"""
prompt = f"Rank this resume based on the job description:\nJob: {job_description}\nResume: {resume_details}"
response = client.text_generation(prompt)
return response
@staticmethod
def recommend_candidates(resume_rankings):
"""Agent to recommend the best candidates"""
prompt = f"Recommend the top candidates based on rankings:\n{resume_rankings}"
response = client.text_generation(prompt)
return response
|