SergeyO7 commited on
Commit
26b5e38
·
verified ·
1 Parent(s): b26fca1

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +2 -0
agent.py CHANGED
@@ -107,6 +107,7 @@ class DuckDuckGoSearchTool(Tool):
107
  print(f"Rate limit reached for web search. Waiting...")
108
  time.sleep(retry_delay)
109
  # Simplified DuckDuckGo search logic (replace with actual implementation)
 
110
  response = requests.get(f"https://lite.duckduckgo.com/lite/?q={query}", timeout=10)
111
  response.raise_for_status()
112
  return response.text # Process results as needed
@@ -166,6 +167,7 @@ class DownloadTaskAttachmentTool(Tool):
166
  description = "Downloads the file attached to the task ID and returns the local file path. Supports Excel (.xlsx), image (.png, .jpg), audio (.mp3), PDF (.pdf), and Python (.py) files."
167
  inputs = {'task_id': {'type': 'string', 'description': 'The task id to download attachment from.'}}
168
  output_type = "string"
 
169
 
170
  def __init__(self, rate_limiter: Optional[Limiter] = None, default_api_url: str = DEFAULT_API_URL, *args, **kwargs):
171
  self.is_initialized = False
 
107
  print(f"Rate limit reached for web search. Waiting...")
108
  time.sleep(retry_delay)
109
  # Simplified DuckDuckGo search logic (replace with actual implementation)
110
+
111
  response = requests.get(f"https://lite.duckduckgo.com/lite/?q={query}", timeout=10)
112
  response.raise_for_status()
113
  return response.text # Process results as needed
 
167
  description = "Downloads the file attached to the task ID and returns the local file path. Supports Excel (.xlsx), image (.png, .jpg), audio (.mp3), PDF (.pdf), and Python (.py) files."
168
  inputs = {'task_id': {'type': 'string', 'description': 'The task id to download attachment from.'}}
169
  output_type = "string"
170
+ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
171
 
172
  def __init__(self, rate_limiter: Optional[Limiter] = None, default_api_url: str = DEFAULT_API_URL, *args, **kwargs):
173
  self.is_initialized = False