Prathamesh1420 commited on
Commit
f41e75a
·
verified ·
1 Parent(s): baf5540

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -1,21 +1,24 @@
1
  import streamlit as st
2
- from crewai import Crew, Agent, Process
3
  from tools import tool
4
- from dotenv import load_dotenv
5
- import os
6
 
7
- # Load environment variables
8
- load_dotenv()
 
9
 
10
  # Initialize Google Generative AI model
11
- from langchain_google_genai import ChatGoogleGenerativeAI
12
  llm = ChatGoogleGenerativeAI(
13
  model="gemini-1.5-flash",
14
  verbose=True,
15
  temperature=0.5,
16
- google_api_key= "AIzaSyDy02GtpV6-VcdeCZNLJT-c4kWuPxBRbrI"
17
  )
18
 
 
 
 
 
19
  # Define agents
20
  news_researcher = Agent(
21
  role="Senior Researcher",
@@ -99,4 +102,3 @@ if st.button("Start Task"):
99
  st.write(result)
100
  else:
101
  st.error("Please enter a topic.")
102
-
 
1
  import streamlit as st
2
+ from crewai import Crew, Agent, Process, Task
3
  from tools import tool
4
+ from langchain_google_genai import ChatGoogleGenerativeAI
 
5
 
6
+ # Define your API keys directly in the code
7
+ GOOGLE_API_KEY = "AIzaSyDy02GtpV6-VcdeCZNLJT-c4kWuPxBRbrI"
8
+ SERPER_API_KEY = "uxSCra7XOaiojmWo3MIQ2xzFWkX2306yJY7YIVMsT771qLCaOJejKKQB7nKbRXd7"
9
 
10
  # Initialize Google Generative AI model
 
11
  llm = ChatGoogleGenerativeAI(
12
  model="gemini-1.5-flash",
13
  verbose=True,
14
  temperature=0.5,
15
+ google_api_key=GOOGLE_API_KEY
16
  )
17
 
18
+ # Initialize the tool for internet searching capabilities
19
+ from crewai_tools import SerperDevTool
20
+ tool = SerperDevTool(api_key=SERPER_API_KEY)
21
+
22
  # Define agents
23
  news_researcher = Agent(
24
  role="Senior Researcher",
 
102
  st.write(result)
103
  else:
104
  st.error("Please enter a topic.")