Revert "feat(firecrawl): add integration tag for Hermes usage in browser and web providers" (#28862)
This reverts commit 273ff5c4a4.
This commit is contained in:
@@ -39,12 +39,6 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
_BASE_URL = "https://api.firecrawl.dev"
|
_BASE_URL = "https://api.firecrawl.dev"
|
||||||
|
|
||||||
# Integration tag sent on every browser-session create so Firecrawl can
|
|
||||||
# attribute Hermes usage. Mirrors FIRECRAWL_INTEGRATION_TAG in the web
|
|
||||||
# plugin; kept here rather than imported to keep the two firecrawl
|
|
||||||
# plugins import-independent.
|
|
||||||
FIRECRAWL_INTEGRATION_TAG = "hermes"
|
|
||||||
|
|
||||||
|
|
||||||
class FirecrawlBrowserProvider(BrowserProvider):
|
class FirecrawlBrowserProvider(BrowserProvider):
|
||||||
"""Firecrawl (https://firecrawl.dev) cloud browser backend.
|
"""Firecrawl (https://firecrawl.dev) cloud browser backend.
|
||||||
@@ -86,10 +80,7 @@ class FirecrawlBrowserProvider(BrowserProvider):
|
|||||||
def create_session(self, task_id: str) -> Dict[str, object]:
|
def create_session(self, task_id: str) -> Dict[str, object]:
|
||||||
ttl = int(os.environ.get("FIRECRAWL_BROWSER_TTL", "300"))
|
ttl = int(os.environ.get("FIRECRAWL_BROWSER_TTL", "300"))
|
||||||
|
|
||||||
body: Dict[str, object] = {
|
body: Dict[str, object] = {"ttl": ttl}
|
||||||
"ttl": ttl,
|
|
||||||
"integration": FIRECRAWL_INTEGRATION_TAG,
|
|
||||||
}
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = requests.post(
|
response = requests.post(
|
||||||
|
|||||||
@@ -56,11 +56,6 @@ from tools.website_policy import check_website_access
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
# Integration tag passed to Firecrawl on every call so they can attribute
|
|
||||||
# usage back to Hermes.
|
|
||||||
FIRECRAWL_INTEGRATION_TAG = "hermes"
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Lazy Firecrawl SDK proxy
|
# Lazy Firecrawl SDK proxy
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
@@ -413,11 +408,7 @@ class FirecrawlWebSearchProvider(WebSearchProvider):
|
|||||||
# let it propagate so the dispatcher emits the legacy envelope shape.
|
# let it propagate so the dispatcher emits the legacy envelope shape.
|
||||||
client = _get_firecrawl_client()
|
client = _get_firecrawl_client()
|
||||||
try:
|
try:
|
||||||
response = client.search(
|
response = client.search(query=query, limit=limit)
|
||||||
query=query,
|
|
||||||
limit=limit,
|
|
||||||
integration=FIRECRAWL_INTEGRATION_TAG,
|
|
||||||
)
|
|
||||||
web_results = _extract_web_search_results(response)
|
web_results = _extract_web_search_results(response)
|
||||||
logger.info("Firecrawl: found %d search results", len(web_results))
|
logger.info("Firecrawl: found %d search results", len(web_results))
|
||||||
return {"success": True, "data": {"web": web_results}}
|
return {"success": True, "data": {"web": web_results}}
|
||||||
@@ -496,7 +487,6 @@ class FirecrawlWebSearchProvider(WebSearchProvider):
|
|||||||
_get_firecrawl_client().scrape,
|
_get_firecrawl_client().scrape,
|
||||||
url=url,
|
url=url,
|
||||||
formats=formats,
|
formats=formats,
|
||||||
integration=FIRECRAWL_INTEGRATION_TAG,
|
|
||||||
),
|
),
|
||||||
timeout=60,
|
timeout=60,
|
||||||
)
|
)
|
||||||
@@ -633,7 +623,6 @@ class FirecrawlWebSearchProvider(WebSearchProvider):
|
|||||||
crawl_params = {
|
crawl_params = {
|
||||||
"limit": limit,
|
"limit": limit,
|
||||||
"scrape_options": {"formats": ["markdown"]},
|
"scrape_options": {"formats": ["markdown"]},
|
||||||
"integration": FIRECRAWL_INTEGRATION_TAG,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# The SDK call is sync; run in a thread so we don't block the
|
# The SDK call is sync; run in a thread so we don't block the
|
||||||
|
|||||||
Reference in New Issue
Block a user