Prathamesh1420 commited on
Commit
7f6c340
1 Parent(s): af4cf37

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
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 = "AIzaSyCeZHse0Jr8PXBQoKFJg7fZkV_t5w6ViBM"
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='./content/fake_resume.md')
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://www.linkedin.com/jobs/collections/recommended/?currentJobId=3971777873&eBP=CwEAAAGQrDjDbzY9VTxQvSF6zCLu0cNQm7McJPCymw_4YJ8KCIVPoQei_6I17FtkEl3pSY6WlAKOhS8fRwXHDF_xfH_JEO-gDqRBLJxgqKKft7TD6vMZusTgtuTByPjJcH6zhNVaUF9wssog8T3wU8gdHVraMmgTdanjeQTJcRy0CP6ynYmlo1mw_XPetqaclf8h5vamDp-M0z-Y5BwEaHiVCSUNf2mfJ7VyAnsInisr2wGPmC0YhFdQzsgRTkdFGFMoejs-xM_lYDnc_22gM5pV4mHXGetgnDxK6Oot_Ip3PHd6jjKJbvcRoLDxK5640RvxV4EkNEUU7cPtw0FcWbg74hvggF1VJquPVNAhNjZpLxh8Hbe94JsEvWQyGiuTSHpG2v0STF8SvT6g3sy04uZwxF7B5dQIAyEcqbrT6hFhpEeWvUtVW30e_Ezehz8T7hLWUV2p_uXW6ZQCKjyPqVwQkre26YtDqQSi38X722bq1qD5Y0wV0cms&refId=TV8NgrFTQZQm7k6gZko9FQ%3D%3D&trackingId=j%2FkIgFHDTmriZJHR%2BxOhOA%3D%3D',
156
  'github_url': 'https://github.com/PrathameshK',
157
  'linkedin_url': 'https://www.linkedin.com/in/prathameshkhade/',
158
- 'personal_writeup': './content/fake_resume.md'
159
  }
160
 
161
  # Running Tasks
162
- results = job_application_crew.run_tasks(inputs=job_application_inputs)
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)