Spaces:
Configuration error
Configuration error
Added logic to not break resume generation if there is no job call summary avalible
Browse files- functions/job_call.py +7 -12
- functions/writer_agent.py +1 -1
functions/job_call.py
CHANGED
@@ -43,24 +43,19 @@ def load_default_job_call() -> str:
|
|
43 |
return ""
|
44 |
|
45 |
|
46 |
-
def summarize_job_call(job_call: str
|
47 |
'''Extracts and summarizes key information from job call.
|
48 |
-
|
49 |
Args:
|
50 |
-
job_call (str
|
51 |
-
|
52 |
-
|
53 |
Returns:
|
54 |
-
str: Summarized job call information, or None if
|
55 |
'''
|
56 |
|
57 |
-
# Use provided job call or load default
|
58 |
if not job_call or not job_call.strip():
|
59 |
-
|
60 |
-
|
61 |
-
if not job_call:
|
62 |
-
logger.warning("No job call text provided and no default available")
|
63 |
-
return None
|
64 |
|
65 |
logger.info("Summarizing job call (%d characters)", len(job_call))
|
66 |
|
|
|
43 |
return ""
|
44 |
|
45 |
|
46 |
+
def summarize_job_call(job_call: str) -> str:
|
47 |
'''Extracts and summarizes key information from job call.
|
48 |
+
|
49 |
Args:
|
50 |
+
job_call (str): Job call text to summarize. Must be provided and non-empty.
|
51 |
+
|
|
|
52 |
Returns:
|
53 |
+
str: Summarized job call information, or None if summarization fails
|
54 |
'''
|
55 |
|
|
|
56 |
if not job_call or not job_call.strip():
|
57 |
+
logger.warning("No job call text provided for summarization")
|
58 |
+
return None
|
|
|
|
|
|
|
59 |
|
60 |
logger.info("Summarizing job call (%d characters)", len(job_call))
|
61 |
|
functions/writer_agent.py
CHANGED
@@ -40,7 +40,7 @@ def write_resume(content: str, user_instructions: str = None, job_summary: str =
|
|
40 |
# Prepare instructions - combine default with user instructions and job summary
|
41 |
instructions = INSTRUCTIONS
|
42 |
|
43 |
-
if job_summary and job_summary.strip():
|
44 |
instructions += f"\n\nJob Requirements and Details:\n{job_summary.strip()}"
|
45 |
logger.info("Added job summary to agent prompt (%d characters)", len(job_summary))
|
46 |
|
|
|
40 |
# Prepare instructions - combine default with user instructions and job summary
|
41 |
instructions = INSTRUCTIONS
|
42 |
|
43 |
+
if job_summary is not None and job_summary.strip():
|
44 |
instructions += f"\n\nJob Requirements and Details:\n{job_summary.strip()}"
|
45 |
logger.info("Added job summary to agent prompt (%d characters)", len(job_summary))
|
46 |
|