Spaces:
Sleeping
Sleeping
Update firecrawler.py
Browse files- firecrawler.py +14 -13
firecrawler.py
CHANGED
|
@@ -1,29 +1,30 @@
|
|
| 1 |
from firecrawl import FirecrawlApp
|
| 2 |
from pydantic import BaseModel, Field
|
| 3 |
from typing import List
|
| 4 |
-
from smolagents import
|
| 5 |
import os
|
| 6 |
|
| 7 |
|
| 8 |
#Fetch API key fior firecrawl
|
| 9 |
api_key = os.getenv("api_key")
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
""
|
| 14 |
-
|
|
|
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
|
| 20 |
-
str: Information about a website
|
| 21 |
|
| 22 |
-
Example:
|
| 23 |
-
>>> # https://au.norton.com
|
| 24 |
-
>>> result = [{"website":{"purpose":"Our best protection, trusted by millions, now includes Genie AI Scam Detection. Advanced tech for advanced threats. Explore plans.","company_name":"Gen Digital Inc."}}]
|
| 25 |
|
| 26 |
-
|
|
|
|
| 27 |
# Initialize the FirecrawlApp with the API key
|
| 28 |
app = FirecrawlApp(api_key = api_key)
|
| 29 |
|
|
|
|
| 1 |
from firecrawl import FirecrawlApp
|
| 2 |
from pydantic import BaseModel, Field
|
| 3 |
from typing import List
|
| 4 |
+
from smolagents import Tool
|
| 5 |
import os
|
| 6 |
|
| 7 |
|
| 8 |
#Fetch API key fior firecrawl
|
| 9 |
api_key = os.getenv("api_key")
|
| 10 |
|
| 11 |
+
|
| 12 |
+
class FireCrawlTool(Tool):
|
| 13 |
+
name = "firecrawl_website_qa"
|
| 14 |
+
description = """
|
| 15 |
+
This tool returns informatuion about websites using an API call"""
|
| 16 |
|
| 17 |
+
inputs = {
|
| 18 |
+
"websites": {
|
| 19 |
+
"type": "string",
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
|
| 23 |
+
output_type = "string"
|
|
|
|
| 24 |
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
+
def forward(self, websites_string: str):
|
| 27 |
+
|
| 28 |
# Initialize the FirecrawlApp with the API key
|
| 29 |
app = FirecrawlApp(api_key = api_key)
|
| 30 |
|