Spaces:
Configuration error
Configuration error
Update crew.py
Browse files
crew.py
CHANGED
|
@@ -7,12 +7,10 @@ import os
|
|
| 7 |
import pandas as pd
|
| 8 |
from crewai import Agent, Crew, Process, Task
|
| 9 |
from crewai.tools import tool
|
| 10 |
-
from crewai_tools import StagehandTool
|
| 11 |
from google import genai
|
| 12 |
from google.genai import types
|
| 13 |
from openinference.instrumentation.crewai import CrewAIInstrumentor
|
| 14 |
from phoenix.otel import register
|
| 15 |
-
from stagehand.schemas import AvailableModel
|
| 16 |
from tools import add, subtract, multiply, divide, modulus
|
| 17 |
from utils import read_file_json, read_docx_text, read_pptx_text, is_ext
|
| 18 |
|
|
@@ -50,12 +48,12 @@ tracer_provider = register(
|
|
| 50 |
def run_crew(question, file_path):
|
| 51 |
# Tools
|
| 52 |
|
| 53 |
-
web_browser_tool = StagehandTool(
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
)
|
| 59 |
|
| 60 |
@tool("Web Search Tool")
|
| 61 |
def web_search_tool(question: str) -> str:
|
|
@@ -334,16 +332,16 @@ def run_crew(question, file_path):
|
|
| 334 |
verbose=True
|
| 335 |
)
|
| 336 |
|
| 337 |
-
web_browser_agent = Agent(
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
)
|
| 347 |
|
| 348 |
image_analysis_agent = Agent(
|
| 349 |
role="Image Analysis Agent",
|
|
@@ -468,7 +466,7 @@ def run_crew(question, file_path):
|
|
| 468 |
|
| 469 |
crew = Crew(
|
| 470 |
agents=[web_search_agent,
|
| 471 |
-
web_browser_agent,
|
| 472 |
image_analysis_agent,
|
| 473 |
audio_analysis_agent,
|
| 474 |
video_analysis_agent,
|
|
|
|
| 7 |
import pandas as pd
|
| 8 |
from crewai import Agent, Crew, Process, Task
|
| 9 |
from crewai.tools import tool
|
|
|
|
| 10 |
from google import genai
|
| 11 |
from google.genai import types
|
| 12 |
from openinference.instrumentation.crewai import CrewAIInstrumentor
|
| 13 |
from phoenix.otel import register
|
|
|
|
| 14 |
from tools import add, subtract, multiply, divide, modulus
|
| 15 |
from utils import read_file_json, read_docx_text, read_pptx_text, is_ext
|
| 16 |
|
|
|
|
| 48 |
def run_crew(question, file_path):
|
| 49 |
# Tools
|
| 50 |
|
| 51 |
+
#web_browser_tool = StagehandTool(
|
| 52 |
+
# api_key=os.environ["BROWSERBASE_API_KEY"],
|
| 53 |
+
# project_id=os.environ["BROWSERBASE_PROJECT_ID"],
|
| 54 |
+
# model_api_key="your-llm-api-key",
|
| 55 |
+
# model_name=AvailableModel.CLAUDE_3_7_SONNET_LATEST,
|
| 56 |
+
#)
|
| 57 |
|
| 58 |
@tool("Web Search Tool")
|
| 59 |
def web_search_tool(question: str) -> str:
|
|
|
|
| 332 |
verbose=True
|
| 333 |
)
|
| 334 |
|
| 335 |
+
#web_browser_agent = Agent(
|
| 336 |
+
# role="Web Browser Agent",
|
| 337 |
+
# goal="Given a question and URL, load the URL and act, extract, navigate, observe, and answer the question: {question}",
|
| 338 |
+
# backstory="As an expert browser assistant, you load the URL and act, extract, navigate, observe to answer the question.",
|
| 339 |
+
# allow_delegation=False,
|
| 340 |
+
# llm=AGENT_MODEL,
|
| 341 |
+
# max_iter=2,
|
| 342 |
+
# tools=[web_browser_tool],
|
| 343 |
+
# verbose=True
|
| 344 |
+
#)
|
| 345 |
|
| 346 |
image_analysis_agent = Agent(
|
| 347 |
role="Image Analysis Agent",
|
|
|
|
| 466 |
|
| 467 |
crew = Crew(
|
| 468 |
agents=[web_search_agent,
|
| 469 |
+
#web_browser_agent,
|
| 470 |
image_analysis_agent,
|
| 471 |
audio_analysis_agent,
|
| 472 |
video_analysis_agent,
|