crawl4ai 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.js +7 -1
- package/dist/sdk.d.ts +4 -3
- package/dist/types.d.ts +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -144,8 +144,8 @@ Extract markdown with various filters:
|
|
|
144
144
|
```typescript
|
|
145
145
|
const markdown = await client.markdown({
|
|
146
146
|
url: 'https://example.com',
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
filter: 'fit', // 'raw' | 'fit' | 'bm25' | 'llm'
|
|
148
|
+
query: 'search query for bm25/llm filters'
|
|
149
149
|
});
|
|
150
150
|
```
|
|
151
151
|
|
package/dist/index.js
CHANGED
|
@@ -342,9 +342,15 @@ class Crawl4AI {
|
|
|
342
342
|
}
|
|
343
343
|
async markdown(request, config) {
|
|
344
344
|
this.validateUrl(request.url);
|
|
345
|
+
const apiRequest = {
|
|
346
|
+
url: request.url,
|
|
347
|
+
...request.filter !== undefined && { f: request.filter },
|
|
348
|
+
...request.query !== undefined && { q: request.query },
|
|
349
|
+
...request.cache !== undefined && { c: request.cache }
|
|
350
|
+
};
|
|
345
351
|
const response = await this.requestWithRetry("/md", {
|
|
346
352
|
method: "POST",
|
|
347
|
-
body: JSON.stringify(
|
|
353
|
+
body: JSON.stringify(apiRequest),
|
|
348
354
|
...config
|
|
349
355
|
});
|
|
350
356
|
return typeof response === "string" ? response : response.markdown;
|
package/dist/sdk.d.ts
CHANGED
|
@@ -91,8 +91,9 @@ export declare class Crawl4AI {
|
|
|
91
91
|
*
|
|
92
92
|
* @param request - Markdown extraction configuration
|
|
93
93
|
* @param request.url - URL to extract markdown from
|
|
94
|
-
* @param request.
|
|
95
|
-
* @param request.
|
|
94
|
+
* @param request.filter - Content filter: 'raw' | 'fit' | 'bm25' | 'llm'
|
|
95
|
+
* @param request.query - Query for BM25/LLM filtering
|
|
96
|
+
* @param request.cache - Cache mode (e.g., 'bypass')
|
|
96
97
|
* @param config - Optional request configuration
|
|
97
98
|
* @returns Promise resolving to markdown string
|
|
98
99
|
*
|
|
@@ -100,7 +101,7 @@ export declare class Crawl4AI {
|
|
|
100
101
|
* ```typescript
|
|
101
102
|
* const markdown = await client.markdown({
|
|
102
103
|
* url: 'https://example.com',
|
|
103
|
-
*
|
|
104
|
+
* filter: 'fit'
|
|
104
105
|
* });
|
|
105
106
|
* ```
|
|
106
107
|
*/
|
package/dist/types.d.ts
CHANGED
|
@@ -133,9 +133,9 @@ export interface CrawlRequest {
|
|
|
133
133
|
}
|
|
134
134
|
export interface MarkdownRequest {
|
|
135
135
|
url: string;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
filter?: ContentFilter;
|
|
137
|
+
query?: string;
|
|
138
|
+
cache?: string;
|
|
139
139
|
}
|
|
140
140
|
export interface HtmlRequest {
|
|
141
141
|
url: string;
|