File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,10 @@ type Config = {
78
78
maxPagesToCrawl: number ;
79
79
/** File name for the finished data */
80
80
outputFileName: string ;
81
+ /** Optional maximum file size in bytes to include in the output file */
82
+ maxFileSize? : number ().,
83
+ /** Optional maximum number tokens to include in the output file */
84
+ maxTokens? : number ().,
81
85
};
82
86
```
83
87
Original file line number Diff line number Diff line change @@ -5,4 +5,6 @@ export const defaultConfig: Config = {
5
5
match : "https://www.builder.io/c/docs/**" ,
6
6
maxPagesToCrawl : 50 ,
7
7
outputFileName : "output.json" ,
8
+ maxFileSize : 1000 ,
9
+ maxTokens : 5000
8
10
} ;
Original file line number Diff line number Diff line change @@ -51,6 +51,16 @@ export const configSchema = z.object({
51
51
. optional ( ) ,
52
52
/** Optional timeout for waiting for a selector to appear */
53
53
waitForSelectorTimeout : z . number ( ) . int ( ) . nonnegative ( ) . optional ( ) ,
54
+
55
+
56
+ /** Optional maximum file size in bytes to include in the output file
57
+ * @example 1000
58
+ */
59
+ maxFileSize : z . number ( ) . int ( ) . positive ( ) . optional ( ) ,
60
+ /** Optional maximum number tokens to include in the output file
61
+ * @example 5000
62
+ */
63
+ maxTokens : z . number ( ) . int ( ) . positive ( ) . optional ( ) ,
54
64
} ) ;
55
65
56
66
export type Config = z . infer < typeof configSchema > ;
You can’t perform that action at this time.
0 commit comments