naman1102 commited on
Commit
0bc0f06
·
1 Parent(s): 9afd718

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_search
13
 
14
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
15
 
@@ -57,7 +57,7 @@ def web_search_tool(state: AgentState) -> AgentState:
57
 
58
  for attempt in range(1, max_retries + 1):
59
  try:
60
- result_text = str(ddg_search(query, max_results=5))
61
  except Exception as e:
62
  # Network error or timeout—retry up to max_retries
63
  if attempt < max_retries:
 
9
  from langchain.schema import HumanMessage
10
  import regex as re
11
  import time
12
+ from duckduckgo_search import search
13
 
14
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
15
 
 
57
 
58
  for attempt in range(1, max_retries + 1):
59
  try:
60
+ result_text = str(search(query, max_results=5))
61
  except Exception as e:
62
  # Network error or timeout—retry up to max_retries
63
  if attempt < max_retries: