bstraehle commited on
Commit
5af9a13
·
verified ·
1 Parent(s): df0ee59

Update crew.py

Browse files
Files changed (1) hide show
  1. crew.py +18 -19
crew.py CHANGED
@@ -7,7 +7,7 @@ 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
@@ -326,23 +326,22 @@ def run_crew(question, file_path):
326
  verbose=True
327
  )
328
 
329
- #web_browser_tool = StagehandTool(
330
- # api_key=os.environ["BROWSERBASE_API_KEY"],
331
- # project_id=os.environ["BROWSERBASE_PROJECT_ID"],
332
- # model_api_key=os.environ["OPENAI_API_KEY"],
333
- # model_name="gpt-4.1"
334
- #)
335
-
336
- #web_browser_agent = Agent(
337
- # role="Web Browser Agent",
338
- # goal="Given a question and URL, load the URL and act, extract, navigate, observe, and answer the question: {question}",
339
- # backstory="As an expert browser assistant, you load the URL and act, extract, navigate, observe to answer the question.",
340
- # allow_delegation=False,
341
- # llm=AGENT_MODEL,
342
- # max_iter=2,
343
- # tools=[web_browser_tool],
344
- # verbose=True
345
- #)
346
 
347
  image_analysis_agent = Agent(
348
  role="Image Analysis Agent",
@@ -467,7 +466,7 @@ def run_crew(question, file_path):
467
 
468
  crew = Crew(
469
  agents=[web_search_agent,
470
- #web_browser_agent,
471
  image_analysis_agent,
472
  audio_analysis_agent,
473
  video_analysis_agent,
 
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
 
326
  verbose=True
327
  )
328
 
329
+ with StagehandTool(
330
+ api_key=os.environ["BROWSERBASE_API_KEY"],
331
+ project_id=os.environ["BROWSERBASE_PROJECT_ID"],
332
+ model_api_key=os.environ["OPENAI_API_KEY"],
333
+ model_name="gpt-4.1"
334
+ ) as web_browser_tool:
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,