bstraehle commited on
Commit
d0b07ce
·
verified ·
1 Parent(s): bff3f4a

Update tools/ai_tools.py

Browse files
Files changed (1) hide show
  1. tools/ai_tools.py +3 -7
tools/ai_tools.py CHANGED
@@ -51,13 +51,12 @@ class AITools():
51
  raise RuntimeError(f"Processing failed: {str(e)}")
52
 
53
  @tool("Web Browser Tool")
54
- def web_browser_tool(question: str, url: str, action: str) -> str:
55
- """Given a question, URL, and action, load the URL and act, extract, or observe to answer the question.
56
 
57
  Args:
58
  question (str): Question about a URL
59
  url (str): The URL
60
- action (str): Act, extract, or observe
61
 
62
  Returns:
63
  str: Answer to the question
@@ -72,12 +71,9 @@ class AITools():
72
  model_name=AvailableModel.CLAUDE_3_7_SONNET_LATEST
73
  )
74
 
75
- print("===>" + os.environ.get("ANTHROPIC_API_KEY")[:5])
76
-
77
  return stagehand_tool.run(
78
  instruction=question,
79
- url=url,
80
- command_type=action
81
  )
82
  except Exception as e:
83
  raise RuntimeError(f"Processing failed: {str(e)}")
 
51
  raise RuntimeError(f"Processing failed: {str(e)}")
52
 
53
  @tool("Web Browser Tool")
54
+ def web_browser_tool(question: str, url: str) -> str:
55
+ """Given a question and URL, load the URL and act, extract, or observe to answer the question.
56
 
57
  Args:
58
  question (str): Question about a URL
59
  url (str): The URL
 
60
 
61
  Returns:
62
  str: Answer to the question
 
71
  model_name=AvailableModel.CLAUDE_3_7_SONNET_LATEST
72
  )
73
 
 
 
74
  return stagehand_tool.run(
75
  instruction=question,
76
+ url=url
 
77
  )
78
  except Exception as e:
79
  raise RuntimeError(f"Processing failed: {str(e)}")