Spaces:
Running
Running
Commit
•
803595b
1
Parent(s):
64b6e2a
Update app.py
Browse files
app.py
CHANGED
@@ -5,12 +5,13 @@ import warnings
|
|
5 |
from crewai import Agent, Task, Crew
|
6 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
7 |
from crewai_tools import FileReadTool, ScrapeWebsiteTool, SerperDevTool
|
|
|
8 |
|
9 |
# Warning control
|
10 |
warnings.filterwarnings('ignore')
|
11 |
|
12 |
# Set the Google API key directly in the code
|
13 |
-
google_api_key = "
|
14 |
|
15 |
# Function to initialize the Gemini model with an event loop
|
16 |
async def initialize_llm():
|
@@ -124,6 +125,7 @@ resume_strategy_task = Task(
|
|
124 |
expected_output=(
|
125 |
"An updated resume that effectively highlights the candidate's qualifications and experiences relevant to the job."
|
126 |
),
|
|
|
127 |
context=[research_task, profile_task],
|
128 |
agent=resume_strategist
|
129 |
)
|
@@ -137,6 +139,7 @@ interview_preparation_task = Task(
|
|
137 |
expected_output=(
|
138 |
"A document containing key questions and talking points that the candidate should prepare for the initial interview."
|
139 |
),
|
|
|
140 |
context=[research_task, profile_task, resume_strategy_task],
|
141 |
agent=interview_preparer
|
142 |
)
|
@@ -157,17 +160,22 @@ job_application_inputs = {
|
|
157 |
}
|
158 |
|
159 |
# Running Tasks
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
st.write("
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
st.write("
|
173 |
-
st.write(results
|
|
|
|
|
|
|
|
|
|
|
|
5 |
from crewai import Agent, Task, Crew
|
6 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
7 |
from crewai_tools import FileReadTool, ScrapeWebsiteTool, SerperDevTool
|
8 |
+
import json
|
9 |
|
10 |
# Warning control
|
11 |
warnings.filterwarnings('ignore')
|
12 |
|
13 |
# Set the Google API key directly in the code
|
14 |
+
google_api_key = "AIzaSyCHHl4LgpZIBw3_Zf15XWuuLSWWIlLROdQ"
|
15 |
|
16 |
# Function to initialize the Gemini model with an event loop
|
17 |
async def initialize_llm():
|
|
|
125 |
expected_output=(
|
126 |
"An updated resume that effectively highlights the candidate's qualifications and experiences relevant to the job."
|
127 |
),
|
128 |
+
output_file="tailored_resume.md",
|
129 |
context=[research_task, profile_task],
|
130 |
agent=resume_strategist
|
131 |
)
|
|
|
139 |
expected_output=(
|
140 |
"A document containing key questions and talking points that the candidate should prepare for the initial interview."
|
141 |
),
|
142 |
+
output_file="interview_materials.md",
|
143 |
context=[research_task, profile_task, resume_strategy_task],
|
144 |
agent=interview_preparer
|
145 |
)
|
|
|
160 |
}
|
161 |
|
162 |
# Running Tasks
|
163 |
+
try:
|
164 |
+
# Assuming job_application_crew.kickoff is an async function
|
165 |
+
results = await job_application_crew.kickoff(inputs=job_application_inputs)
|
166 |
+
|
167 |
+
# Print type and contents for debugging
|
168 |
+
st.write("Type of results:", type(results))
|
169 |
+
st.write("Contents of results:", results)
|
170 |
+
|
171 |
+
# Check if results is a dictionary
|
172 |
+
if isinstance(results, dict):
|
173 |
+
# Display results based on their expected keys
|
174 |
+
st.write("Job Requirements:", results.get('job_requirements', 'No job requirements found'))
|
175 |
+
st.write("Personal Profile:", results.get('personal_profile', 'No personal profile found'))
|
176 |
+
st.write("Tailored Resume:", results.get('tailored_resume', 'No tailored resume found'))
|
177 |
+
st.write("Interview Materials:", results.get('interview_materials', 'No interview materials found'))
|
178 |
+
else:
|
179 |
+
st.write("Unexpected results format:", results)
|
180 |
+
except Exception as e:
|
181 |
+
st.error(f"An error occurred: {e}")
|