Skip to content

Commit c6b770a

Browse files
Add optional maxFileSize and maxTokens to Config
1 parent 7419030 commit c6b770a

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ type Config = {
7878
maxPagesToCrawl: number;
7979
/** File name for the finished data */
8080
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().,
8185
};
8286
```
8387

config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ export const defaultConfig: Config = {
55
match: "https://www.builder.io/c/docs/**",
66
maxPagesToCrawl: 50,
77
outputFileName: "output.json",
8+
maxFileSize: 1000,
9+
maxTokens: 5000
810
};

src/config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ export const configSchema = z.object({
5151
.optional(),
5252
/** Optional timeout for waiting for a selector to appear */
5353
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(),
5464
});
5565

5666
export type Config = z.infer<typeof configSchema>;

0 commit comments

Comments
 (0)