Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,8 @@
|
|
| 1 |
import os
|
| 2 |
import gradio as gr
|
| 3 |
from crewai import Agent, Task, Crew, Process
|
| 4 |
-
# CORRECTED IMPORTS FOR
|
| 5 |
-
from crewai_tools
|
| 6 |
-
from crewai_tools.tools.file_tools import FileWriteTool
|
| 7 |
# ---
|
| 8 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
| 9 |
|
|
@@ -21,9 +20,9 @@ except Exception as e:
|
|
| 21 |
llm = None
|
| 22 |
|
| 23 |
# --- 2. DEFINE TOOLS AND OUTPUT DIRECTORY ---
|
| 24 |
-
search_tool =
|
| 25 |
os.makedirs("outputs", exist_ok=True)
|
| 26 |
-
file_write_tool =
|
| 27 |
|
| 28 |
# --- 3. DEFINE THE AGENT TEAM ---
|
| 29 |
designer = Agent(
|
|
@@ -142,4 +141,4 @@ iface = gr.Interface(
|
|
| 142 |
)
|
| 143 |
|
| 144 |
if __name__ == "__main__":
|
| 145 |
-
iface.launch()
|
|
|
|
| 1 |
import os
|
| 2 |
import gradio as gr
|
| 3 |
from crewai import Agent, Task, Crew, Process
|
| 4 |
+
# CORRECTED IMPORTS FOR NEWER VERSIONS
|
| 5 |
+
from crewai_tools import DuckDuckGoSearchRun, FileWriterTool
|
|
|
|
| 6 |
# ---
|
| 7 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
| 8 |
|
|
|
|
| 20 |
llm = None
|
| 21 |
|
| 22 |
# --- 2. DEFINE TOOLS AND OUTPUT DIRECTORY ---
|
| 23 |
+
search_tool = DuckDuckGoSearchRun()
|
| 24 |
os.makedirs("outputs", exist_ok=True)
|
| 25 |
+
file_write_tool = FileWriterTool(file_path="outputs/index.html")
|
| 26 |
|
| 27 |
# --- 3. DEFINE THE AGENT TEAM ---
|
| 28 |
designer = Agent(
|
|
|
|
| 141 |
)
|
| 142 |
|
| 143 |
if __name__ == "__main__":
|
| 144 |
+
iface.launch()
|