Skip to content

Commit a008df1

Browse files
committed
docs: add JSDoc to crwScrape and crwCrawl public APIs
1 parent cd1884e commit a008df1

1 file changed

Lines changed: 32 additions & 2 deletions

File tree

  • src/praisonai-ts/src/tools/builtins

src/praisonai-ts/src/tools/builtins/crw.ts

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,22 @@ async function loadCrwPackage() {
9797
}
9898

9999
/**
100-
* Create a fastCRW Scrape tool
100+
* Create a fastCRW Scrape tool.
101+
*
102+
* Scrapes a single web page using the Firecrawl-compatible fastCRW API,
103+
* returning LLM-ready content in markdown and optionally HTML, links, and metadata.
104+
*
105+
* @param config - Optional scraping configuration (formats, content filters, wait time).
106+
* @returns A PraisonTool that scrapes a single web page.
107+
*
108+
* @example
109+
* ```typescript
110+
* import { crwScrape } from 'praisonai';
111+
*
112+
* const scraper = crwScrape({ formats: ['markdown', 'links'], onlyMainContent: true });
113+
* const result = await scraper.execute({ url: 'https://example.com' });
114+
* console.log(result.content);
115+
* ```
101116
*/
102117
export function crwScrape(config?: CrwScrapeConfig): PraisonTool<CrwScrapeInput, CrwScrapeResult> {
103118
return {
@@ -139,7 +154,22 @@ export function crwScrape(config?: CrwScrapeConfig): PraisonTool<CrwScrapeInput,
139154
}
140155

141156
/**
142-
* Create a fastCRW Crawl tool
157+
* Create a fastCRW Crawl tool.
158+
*
159+
* Crawls a website starting from a URL, following links and extracting content
160+
* from multiple pages using the Firecrawl-compatible fastCRW API.
161+
*
162+
* @param config - Optional crawl configuration (depth limits, path filters, link policies).
163+
* @returns A PraisonTool that crawls a website and extracts content from multiple pages.
164+
*
165+
* @example
166+
* ```typescript
167+
* import { crwCrawl } from 'praisonai';
168+
*
169+
* const crawler = crwCrawl({ limit: 10, maxDepth: 2, includePaths: ['/docs'] });
170+
* const result = await crawler.execute({ url: 'https://example.com' });
171+
* console.log(result.pages.length, 'pages crawled');
172+
* ```
143173
*/
144174
export function crwCrawl(config?: CrwCrawlConfig): PraisonTool<CrwCrawlInput, CrwCrawlResult> {
145175
return {

0 commit comments

Comments
 (0)