Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,10 @@
|
|
| 1 |
-
|
| 2 |
import os
|
| 3 |
import streamlit as st
|
| 4 |
from dotenv import load_dotenv
|
| 5 |
from crewai import Agent, Task, Crew, Process
|
| 6 |
from langchain.tools import DuckDuckGoSearchRun
|
|
|
|
| 7 |
|
| 8 |
# Load environment variables
|
| 9 |
load_dotenv()
|
|
@@ -34,8 +35,13 @@ 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 |
-
# Initialize the search tool
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
status.update(label="🔍 Creating AI agents...")
|
| 41 |
# Create agents
|
|
|
|
| 1 |
+
app.py
|
| 2 |
import os
|
| 3 |
import streamlit as st
|
| 4 |
from dotenv import load_dotenv
|
| 5 |
from crewai import Agent, Task, Crew, Process
|
| 6 |
from langchain.tools import DuckDuckGoSearchRun
|
| 7 |
+
from langchain_core.tools import Tool
|
| 8 |
|
| 9 |
# Load environment variables
|
| 10 |
load_dotenv()
|
|
|
|
| 35 |
def run_market_research(topic):
|
| 36 |
with st.status("🤖 AI Crew working on your report...", expanded=True) as status:
|
| 37 |
try:
|
| 38 |
+
# Initialize the search tool properly
|
| 39 |
+
search = DuckDuckGoSearchRun()
|
| 40 |
+
search_tool = Tool(
|
| 41 |
+
name="Search",
|
| 42 |
+
func=search.run,
|
| 43 |
+
description="Search the internet for information about markets and companies"
|
| 44 |
+
)
|
| 45 |
|
| 46 |
status.update(label="🔍 Creating AI agents...")
|
| 47 |
# Create agents
|