Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
import streamlit as st
|
| 3 |
from dotenv import load_dotenv
|
| 4 |
from crewai import Agent, Task, Crew, Process
|
| 5 |
-
from
|
| 6 |
-
from langchain_core.tools import Tool
|
| 7 |
|
| 8 |
# Load environment variables
|
| 9 |
load_dotenv()
|
|
@@ -34,13 +42,8 @@ st.markdown("""
|
|
| 34 |
def run_market_research(topic):
|
| 35 |
with st.status("🤖 AI Crew working on your report...", expanded=True) as status:
|
| 36 |
try:
|
| 37 |
-
#
|
| 38 |
-
|
| 39 |
-
search_tool = Tool(
|
| 40 |
-
name="Search",
|
| 41 |
-
func=search.run,
|
| 42 |
-
description="Search the internet for information about markets and companies"
|
| 43 |
-
)
|
| 44 |
|
| 45 |
status.update(label="🔍 Creating AI agents...")
|
| 46 |
# Create agents
|
|
@@ -147,7 +150,7 @@ def main():
|
|
| 147 |
if not topic:
|
| 148 |
st.error("Please enter a research topic")
|
| 149 |
return
|
| 150 |
-
|
| 151 |
report = run_market_research(topic)
|
| 152 |
|
| 153 |
if report:
|
|
|
|
| 1 |
+
# requirements.txt
|
| 2 |
+
crewai==0.11.0
|
| 3 |
+
langchain==0.1.0
|
| 4 |
+
python-dotenv==1.0.0
|
| 5 |
+
streamlit==1.29.0
|
| 6 |
+
duckduckgo-search==3.9.3
|
| 7 |
+
openai==1.3.0
|
| 8 |
+
|
| 9 |
+
# app.py
|
| 10 |
import os
|
| 11 |
import streamlit as st
|
| 12 |
from dotenv import load_dotenv
|
| 13 |
from crewai import Agent, Task, Crew, Process
|
| 14 |
+
from crewai.tools import WebsiteSearchTool
|
|
|
|
| 15 |
|
| 16 |
# Load environment variables
|
| 17 |
load_dotenv()
|
|
|
|
| 42 |
def run_market_research(topic):
|
| 43 |
with st.status("🤖 AI Crew working on your report...", expanded=True) as status:
|
| 44 |
try:
|
| 45 |
+
# Use CrewAI's built-in tool
|
| 46 |
+
search_tool = WebsiteSearchTool()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
status.update(label="🔍 Creating AI agents...")
|
| 49 |
# Create agents
|
|
|
|
| 150 |
if not topic:
|
| 151 |
st.error("Please enter a research topic")
|
| 152 |
return
|
| 153 |
+
|
| 154 |
report = run_market_research(topic)
|
| 155 |
|
| 156 |
if report:
|