gperdrizet commited on
Commit
91b2483
·
1 Parent(s): 30f8ee0

Added one-step resume writer 'agent' that reformats the information parsed from the linkedin profile export as clean markdown.

Browse files
configuration.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Global configuration for the Resumate application."""
2
+
3
+ from smolagents import OpenAIServerModel
4
+
5
+ AGENT_MODEL = OpenAIServerModel(
6
+ model_id="gpt-4.1",
7
+ max_tokens=8000
8
+ )
9
+
10
+ INSTRUCTIONS = """
11
+ You are an AI agent responsible for writing a resume based on the provided context. Your task is to generate a well-structured and professional resume that highlights the user's skills, experiences, and achievements.
12
+ You will receive structured text extracted from a LinkedIn profile PDF and GitHub. Use this information to create a comprehensive resume that includes the following sections:
13
+ - Contact Information
14
+ - Summary
15
+ - Skills
16
+ - Work Experience
17
+ - Education
18
+
19
+ Format the resume using Markdown syntax, ensuring that it is easy to read and visually appealing. Use appropriate headings, bullet points, and formatting to enhance clarity and presentation.
20
+ """
functions/gradio.py CHANGED
@@ -7,6 +7,7 @@ Functions for handling Gradio UI interactions and processing user inputs.
7
  import logging
8
  from functions.linkedin_resume import extract_text_from_linkedin_pdf
9
  from functions.github import get_github_repositories
 
10
 
11
  # Set up logging
12
  logging.basicConfig(level=logging.INFO)
@@ -78,6 +79,9 @@ def process_inputs(linkedin_pdf, github_url, job_post_text):
78
  logger.info("No job post text provided")
79
 
80
  logger.info("Input processing completed")
 
 
 
81
  return result
82
 
83
 
 
7
  import logging
8
  from functions.linkedin_resume import extract_text_from_linkedin_pdf
9
  from functions.github import get_github_repositories
10
+ from functions.writer_agent import write_resume
11
 
12
  # Set up logging
13
  logging.basicConfig(level=logging.INFO)
 
79
  logger.info("No job post text provided")
80
 
81
  logger.info("Input processing completed")
82
+
83
+ resume = write_resume(extraction_result)
84
+
85
  return result
86
 
87
 
functions/writer_agent.py ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ '''Agent responsible for writing the resume based on user provided context'''
2
+
3
+ import json
4
+ import logging
5
+ from smolagents import CodeAgent
6
+ from configuration import AGENT_MODEL, INSTRUCTIONS
7
+
8
+ logging.basicConfig(level=logging.INFO)
9
+ logger = logging.getLogger(__name__)
10
+
11
+ def write_resume(content: str) -> str:
12
+
13
+ """
14
+ Generates a resume based on the provided content.
15
+
16
+ Args:
17
+ content (str): The content to be used for generating the resume.
18
+
19
+ Returns:
20
+ str: The generated resume.
21
+ """
22
+
23
+ if content['status'] == 'success':
24
+
25
+ agent = CodeAgent(
26
+ model=AGENT_MODEL,
27
+ tools=[],
28
+ additional_authorized_imports=['json'],
29
+ name="writer_agent",
30
+ verbosity_level=5,
31
+ max_steps=20,
32
+ planning_interval=5
33
+ )
34
+
35
+ submitted_answer = agent.run(
36
+ INSTRUCTIONS + '\n' + json.dumps(content['structured_text']),
37
+ )
38
+
39
+ logger.info("submitted_answer: %s", submitted_answer)
40
+
41
+ return submitted_answer
requirements.txt CHANGED
@@ -1,3 +1,4 @@
1
  gradio==5.35.0
2
- PyPDF2==3.0.1
3
- requests==2.31.0
 
 
1
  gradio==5.35.0
2
+ PyPDF2
3
+ requests
4
+ smolagents[openai]