Skip to content

Commit

Permalink
Nick: extract urls to extract
Browse files Browse the repository at this point in the history
  • Loading branch information
nickscamara committed Nov 19, 2024
1 parent 2fb8a3c commit d02a8bc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/js-sdk/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
Expand Down
4 changes: 2 additions & 2 deletions apps/js-sdk/firecrawl/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<ExtractResponse | ErrorResponse> {
async extract(urls: string[], params?: ExtractParams): Promise<ExtractResponse | ErrorResponse> {
const headers = this.prepareHeaders();

if (!params?.prompt) {
Expand Down
2 changes: 1 addition & 1 deletion apps/python-sdk/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down
2 changes: 1 addition & 1 deletion apps/python-sdk/firecrawl/firecrawl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d02a8bc

Please sign in to comment.