Spaces:
Running
Running
Commit
•
7f6c340
1
Parent(s):
af4cf37
Update app.py
Browse files
app.py
CHANGED
@@ -6,14 +6,11 @@ from crewai import Agent, Task, Crew
|
|
6 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
7 |
from crewai_tools import FileReadTool, ScrapeWebsiteTool, SerperDevTool
|
8 |
|
9 |
-
# Set a dummy key to prevent KeyError
|
10 |
-
os.environ['OPENAI_API_KEY'] = 'dummy_key'
|
11 |
-
|
12 |
# Warning control
|
13 |
warnings.filterwarnings('ignore')
|
14 |
|
15 |
# Set the Google API key directly in the code
|
16 |
-
google_api_key = "
|
17 |
|
18 |
# Function to initialize the Gemini model with an event loop
|
19 |
async def initialize_llm():
|
@@ -30,10 +27,13 @@ if not hasattr(st, 'llm'):
|
|
30 |
asyncio.set_event_loop(loop)
|
31 |
st.llm = loop.run_until_complete(initialize_llm())
|
32 |
|
|
|
|
|
|
|
|
|
33 |
# Initialize tools
|
34 |
-
search_tool = SerperDevTool()
|
35 |
scrape_tool = ScrapeWebsiteTool()
|
36 |
-
read_resume = FileReadTool(file_path='
|
37 |
|
38 |
# Define agents
|
39 |
researcher = Agent(
|
@@ -152,14 +152,14 @@ job_application_crew = Crew(
|
|
152 |
|
153 |
# Job Application Inputs
|
154 |
job_application_inputs = {
|
155 |
-
'job_posting_url': 'https://
|
156 |
'github_url': 'https://github.com/PrathameshK',
|
157 |
'linkedin_url': 'https://www.linkedin.com/in/prathameshkhade/',
|
158 |
-
'personal_writeup': '
|
159 |
}
|
160 |
|
161 |
# Running Tasks
|
162 |
-
results = job_application_crew.
|
163 |
|
164 |
# Display Results
|
165 |
st.write(results)
|
|
|
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 = "AIzaSyCHHl4LgpZIBw3_Zf15XWuuLSWWIlLROdQ"
|
14 |
|
15 |
# Function to initialize the Gemini model with an event loop
|
16 |
async def initialize_llm():
|
|
|
27 |
asyncio.set_event_loop(loop)
|
28 |
st.llm = loop.run_until_complete(initialize_llm())
|
29 |
|
30 |
+
# Ensure the SERPER API key is correctly passed during initialization
|
31 |
+
serper_api_key = "42e088db08191f8f2f7d516a9016f579306b5d6d3940d86d840d5370207a5b6c" # Replace with your actual API key
|
32 |
+
search_tool = SerperDevTool(api_key=serper_api_key)
|
33 |
+
|
34 |
# Initialize tools
|
|
|
35 |
scrape_tool = ScrapeWebsiteTool()
|
36 |
+
read_resume = FileReadTool(file_path='fake_resume.md')
|
37 |
|
38 |
# Define agents
|
39 |
researcher = Agent(
|
|
|
152 |
|
153 |
# Job Application Inputs
|
154 |
job_application_inputs = {
|
155 |
+
'job_posting_url': 'https://jobs.lever.co/AIFund/6c82e23e-d954-4dd8-a734-c0c2c5ee00f1?lever-origin=applied&lever-source%5B%5D=AI+Fund',
|
156 |
'github_url': 'https://github.com/PrathameshK',
|
157 |
'linkedin_url': 'https://www.linkedin.com/in/prathameshkhade/',
|
158 |
+
'personal_writeup': 'fake_resume.md'
|
159 |
}
|
160 |
|
161 |
# Running Tasks
|
162 |
+
results = job_application_crew.kickoff(inputs=job_application_inputs)
|
163 |
|
164 |
# Display Results
|
165 |
st.write(results)
|