Spaces:
Running
Running
Sync WebFetch schema compatibility
Browse files279 unmodified lines28028128228328428528628728828929029186 unmodified lines378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410279 unmodified lines"type": "object","properties": {"url": {"type": ["string", "array"],"items": {"type": "string",},"minItems": 1,"description": "The URL(s) of the webpage(s) to visit. Can be a single URL or an array of URLs.",},"start_line": {"type": "integer",86 unmodified linesexcept ValueError as exc:return f"[WebFetch] {exc}"if isinstance(url, str):response = self.readpage_jina(url,start_line=start_line,end_line=end_line,max_chars=max_chars,runtime_deadline=runtime_deadline,)elif isinstance(url, list):response = []for one_url in url:remaining = self._remaining_budget_seconds(runtime_deadline)if remaining is not None and remaining <= 0:cur_response = "[WebFetch] Failed to read page: agent runtime limit reached."response.append(cur_response)continuecur_response = self.readpage_jina(one_url,start_line=start_line,end_line=end_line,max_chars=max_chars,runtime_deadline=runtime_deadline,)response.append(cur_response)response = "\n=======\n".join(response)else:return "[WebFetch] 'url' must be a string or a list of strings."if visit_debug_enabled():print(f"WebFetch Length {len(response)}")279 unmodified lines28028128228328428528628786 unmodified lines374375376377378379380381382383384385386279 unmodified lines"type": "object","properties": {"url": {"type": "string","description": "The URL of the webpage to visit. Call WebFetch multiple times for multiple URLs.",},"start_line": {"type": "integer",86 unmodified linesexcept ValueError as exc:return f"[WebFetch] {exc}"response = self.readpage_jina(url,start_line=start_line,end_line=end_line,max_chars=max_chars,runtime_deadline=runtime_deadline,)if visit_debug_enabled():print(f"WebFetch Length {len(response)}")
agent_base/tools/tool_web.py+9-33