update basetool dependencies to use root crewai repo

This commit is contained in:
Brandon Hancock
2024-12-05 13:16:48 -05:00
parent e1482d740f
commit d5fb31e645
31 changed files with 82 additions and 163 deletions

View File

@@ -4,10 +4,9 @@ from typing import Any, Optional, Type
import requests
from bs4 import BeautifulSoup
from crewai.tools import BaseTool
from pydantic import BaseModel, Field
from ..base_tool import BaseTool
class FixedScrapeWebsiteToolSchema(BaseModel):
"""Input for ScrapeWebsiteTool."""
@@ -69,6 +68,6 @@ class ScrapeWebsiteTool(BaseTool):
parsed = BeautifulSoup(page.text, "html.parser")
text = parsed.get_text(" ")
text = re.sub('[ \t]+', ' ', text)
text = re.sub('\\s+\n\\s+', '\n', text)
text = re.sub("[ \t]+", " ", text)
text = re.sub("\\s+\n\\s+", "\n", text)
return text