SuccessfulCrab commited on
Commit
717c28a
·
verified ·
1 Parent(s): a7db9a2

Update firecrawler.py

Browse files
Files changed (1) hide show
  1. 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 tool
5
  import os
6
 
7
 
8
  #Fetch API key fior firecrawl
9
  api_key = os.getenv("api_key")
10
 
11
- @tool
12
- def execute_firecrawl(websites_string: str):
13
- """
14
- This tool scans a url and returns its intended purpose
 
15
 
16
- Args:
17
- websites_string (str): A string of websites separated by commas, spaces, or new lines
 
 
 
18
 
19
- Returns:
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