Spaces:
Sleeping
Sleeping
| 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 | |
| def extractor(text): | |
| task_details = TaskExtractor(resume=text).extract() | |
| assert isinstance(task_details, TaskDetails) | |
| return task_details | |