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: List[str] past_company_experience: int about_section: str class TaskExtractor(OpenAIExtractor[TaskDetails]): extract_schema: Type[TaskDetails] = TaskDetails prompt_template = """ Extract the Resume details from the following Resume: Note: Extract Experience by calculating the working tenure {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