Spaces:
Sleeping
Sleeping
File size: 821 Bytes
3f4a167 | 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 | from mirascope.openai import OpenAIExtractor
from mirascope.gemini import GeminiExtractor
from mirascope.groq import GroqExtractor
from retry import retry
from pydantic import FilePath, BaseModel
from typing import List, Type
class TaskDetails(BaseModel):
name: str
email: str
phone_number: str
skills: List[str]
education: str
past_company_experience: str
about_section: str
class TaskExtractor(OpenAIExtractor[TaskDetails]):
extract_schema: Type[TaskDetails] = TaskDetails
prompt_template = """
Extract the Resume details from the following Resume:
{resume}
"""
resume: str
@retry(tries=3, delay=2, backoff=2)
def extractor(text):
task_details = TaskExtractor(resume=text).extract()
assert isinstance(task_details, TaskDetails)
return task_details
|