naman1102 commited on
Commit
b067047
·
1 Parent(s): fadaecd

Update tools.py

Browse files
Files changed (1) hide show
  1. tools.py +2 -2
tools.py CHANGED
@@ -9,7 +9,7 @@ from state import AgentState
9
  from langchain.schema import HumanMessage
10
  import regex as re
11
  import time
12
- from duckduckgo_search import ddg
13
 
14
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
15
 
@@ -56,7 +56,7 @@ def web_search_tool(state: AgentState) -> AgentState:
56
 
57
  for attempt in range(1, max_retries + 1):
58
  try:
59
- result_text = str(ddg(query, max_results=5))
60
  except Exception as e:
61
  # Network error or timeout—retry up to max_retries
62
  if attempt < max_retries:
 
9
  from langchain.schema import HumanMessage
10
  import regex as re
11
  import time
12
+ from duckduckgo_search import ddg_search
13
 
14
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
15
 
 
56
 
57
  for attempt in range(1, max_retries + 1):
58
  try:
59
+ result_text = str(ddg_search(query, max_results=5))
60
  except Exception as e:
61
  # Network error or timeout—retry up to max_retries
62
  if attempt < max_retries: