From d02a8bcb82a83e77531bc38e2730d4c828df879f Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 19 Nov 2024 13:49:23 -0800 Subject: [PATCH] Nick: extract urls to extract --- apps/js-sdk/example.js | 2 +- apps/js-sdk/firecrawl/src/index.ts | 4 ++-- apps/python-sdk/example.py | 2 +- apps/python-sdk/firecrawl/firecrawl.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/js-sdk/example.js b/apps/js-sdk/example.js index 166cc18da6..21bdb2a1ba 100644 --- a/apps/js-sdk/example.js +++ b/apps/js-sdk/example.js @@ -50,7 +50,7 @@ const main = async () => { links: z.array(z.string()) }); - const extractResult = await app.extractUrls(['https://firecrawl.dev'], { + const extractResult = await app.extract(['https://firecrawl.dev'], { prompt: "Extract the title, description, and links from the website", schema: extractSchema }); diff --git a/apps/js-sdk/firecrawl/src/index.ts b/apps/js-sdk/firecrawl/src/index.ts index 16cf674f84..b6737855e9 100644 --- a/apps/js-sdk/firecrawl/src/index.ts +++ b/apps/js-sdk/firecrawl/src/index.ts @@ -699,12 +699,12 @@ export default class FirecrawlApp { } /** - * Extracts information from a URL using the Firecrawl API. + * Extracts information from URLs using the Firecrawl API. * @param url - The URL to extract information from. * @param params - Additional parameters for the extract request. * @returns The response from the extract operation. */ - async extractUrls(urls: string[], params?: ExtractParams): Promise { + async extract(urls: string[], params?: ExtractParams): Promise { const headers = this.prepareHeaders(); if (!params?.prompt) { diff --git a/apps/python-sdk/example.py b/apps/python-sdk/example.py index eba7cfd24e..686b767631 100644 --- a/apps/python-sdk/example.py +++ b/apps/python-sdk/example.py @@ -124,7 +124,7 @@ class ExtractSchema(BaseModel): extract_schema = ExtractSchema.schema() # Perform the extraction -extract_result = app.extract_urls(['https://firecrawl.dev'], { +extract_result = app.extract(['https://firecrawl.dev'], { 'prompt': "Extract the title, description, and links from the website", 'schema': extract_schema }) diff --git a/apps/python-sdk/firecrawl/firecrawl.py b/apps/python-sdk/firecrawl/firecrawl.py index 9dc9b47b32..bb87906c15 100644 --- a/apps/python-sdk/firecrawl/firecrawl.py +++ b/apps/python-sdk/firecrawl/firecrawl.py @@ -460,7 +460,7 @@ def check_batch_scrape_status(self, id: str) -> Any: self._handle_error(response, 'check batch scrape status') - def extract_urls(self, urls: List[str], params: Optional[ExtractParams] = None) -> Union[ExtractResponse, ErrorResponse]: + def extract(self, urls: List[str], params: Optional[ExtractParams] = None) -> Union[ExtractResponse, ErrorResponse]: """ Extracts information from a URL using the Firecrawl API.