@@ -33,8 +33,11 @@ async def ingest_async(
33
33
source : str ,
34
34
* ,
35
35
max_file_size : int = MAX_FILE_SIZE ,
36
- include_patterns : str | set [str ] | None = None ,
36
+ max_files : int | None = None ,
37
+ max_total_size_bytes : int | None = None ,
38
+ max_directory_depth : int | None = None ,
37
39
exclude_patterns : str | set [str ] | None = None ,
40
+ include_patterns : str | set [str ] | None = None ,
38
41
branch : str | None = None ,
39
42
tag : str | None = None ,
40
43
include_gitignored : bool = False ,
@@ -51,17 +54,23 @@ async def ingest_async(
51
54
Parameters
52
55
----------
53
56
source : str
54
- The source to analyze, which can be a URL (for a Git repository) or a local directory path .
57
+ A directory path or a Git repository URL .
55
58
max_file_size : int
56
- Maximum allowed file size for file ingestion. Files larger than this size are ignored (default: 10 MB).
57
- include_patterns : str | set[str] | None
58
- Pattern or set of patterns specifying which files to include. If ``None``, all files are included.
59
+ Maximum file size in bytes to ingest (default: 10 MB).
60
+ max_files : int | None
61
+ Maximum number of files to ingest (default: 10,000).
62
+ max_total_size_bytes : int | None
63
+ Maximum total size of output file in bytes (default: 500 MB).
64
+ max_directory_depth : int | None
65
+ Maximum depth of directory traversal (default: 20).
59
66
exclude_patterns : str | set[str] | None
60
- Pattern or set of patterns specifying which files to exclude. If ``None``, no files are excluded.
67
+ Glob patterns for pruning the file set.
68
+ include_patterns : str | set[str] | None
69
+ Glob patterns for including files in the output.
61
70
branch : str | None
62
- The branch to clone and ingest (default: the default branch).
71
+ Git branch to clone and ingest (default: the default branch).
63
72
tag : str | None
64
- The tag to clone and ingest. If ``None``, no tag is used.
73
+ Git tag to to clone and ingest. If ``None``, no tag is used.
65
74
include_gitignored : bool
66
75
If ``True``, include files ignored by ``.gitignore`` and ``.gitingestignore`` (default: ``False``).
67
76
include_submodules : bool
@@ -70,7 +79,7 @@ async def ingest_async(
70
79
GitHub personal access token (PAT) for accessing private repositories.
71
80
Can also be set via the ``GITHUB_TOKEN`` environment variable.
72
81
output : str | None
73
- File path where the summary and content should be written.
82
+ File path where the summary and content is written.
74
83
If ``"-"`` (dash), the results are written to ``stdout``.
75
84
If ``None``, the results are not written to a file.
76
85
@@ -107,6 +116,13 @@ async def ingest_async(
107
116
if query .url :
108
117
_override_branch_and_tag (query , branch = branch , tag = tag )
109
118
119
+ if max_files is not None :
120
+ query .max_files = max_files
121
+ if max_total_size_bytes is not None :
122
+ query .max_total_size_bytes = max_total_size_bytes
123
+ if max_directory_depth is not None :
124
+ query .max_directory_depth = max_directory_depth
125
+
110
126
query .include_submodules = include_submodules
111
127
112
128
async with _clone_repo_if_remote (query , token = token ):
@@ -121,8 +137,11 @@ def ingest(
121
137
source : str ,
122
138
* ,
123
139
max_file_size : int = MAX_FILE_SIZE ,
124
- include_patterns : str | set [str ] | None = None ,
140
+ max_files : int | None = None ,
141
+ max_total_size_bytes : int | None = None ,
142
+ max_directory_depth : int | None = None ,
125
143
exclude_patterns : str | set [str ] | None = None ,
144
+ include_patterns : str | set [str ] | None = None ,
126
145
branch : str | None = None ,
127
146
tag : str | None = None ,
128
147
include_gitignored : bool = False ,
@@ -139,17 +158,23 @@ def ingest(
139
158
Parameters
140
159
----------
141
160
source : str
142
- The source to analyze, which can be a URL (for a Git repository) or a local directory path .
161
+ A directory path or a Git repository URL .
143
162
max_file_size : int
144
- Maximum allowed file size for file ingestion. Files larger than this size are ignored (default: 10 MB).
145
- include_patterns : str | set[str] | None
146
- Pattern or set of patterns specifying which files to include. If ``None``, all files are included.
163
+ Maximum file size in bytes to ingest (default: 10 MB).
164
+ max_files : int | None
165
+ Maximum number of files to ingest (default: 10,000).
166
+ max_total_size_bytes : int | None
167
+ Maximum total size of output file in bytes (default: 500 MB).
168
+ max_directory_depth : int | None
169
+ Maximum depth of directory traversal (default: 20).
147
170
exclude_patterns : str | set[str] | None
148
- Pattern or set of patterns specifying which files to exclude. If ``None``, no files are excluded.
171
+ Glob patterns for pruning the file set.
172
+ include_patterns : str | set[str] | None
173
+ Glob patterns for including files in the output.
149
174
branch : str | None
150
- The branch to clone and ingest (default: the default branch).
175
+ Git branch to clone and ingest (default: the default branch).
151
176
tag : str | None
152
- The tag to clone and ingest. If ``None``, no tag is used.
177
+ Git tag to to clone and ingest. If ``None``, no tag is used.
153
178
include_gitignored : bool
154
179
If ``True``, include files ignored by ``.gitignore`` and ``.gitingestignore`` (default: ``False``).
155
180
include_submodules : bool
@@ -158,7 +183,7 @@ def ingest(
158
183
GitHub personal access token (PAT) for accessing private repositories.
159
184
Can also be set via the ``GITHUB_TOKEN`` environment variable.
160
185
output : str | None
161
- File path where the summary and content should be written.
186
+ File path where the summary and content is written.
162
187
If ``"-"`` (dash), the results are written to ``stdout``.
163
188
If ``None``, the results are not written to a file.
164
189
@@ -179,8 +204,11 @@ def ingest(
179
204
ingest_async (
180
205
source = source ,
181
206
max_file_size = max_file_size ,
182
- include_patterns = include_patterns ,
207
+ max_files = max_files ,
208
+ max_total_size_bytes = max_total_size_bytes ,
209
+ max_directory_depth = max_directory_depth ,
183
210
exclude_patterns = exclude_patterns ,
211
+ include_patterns = include_patterns ,
184
212
branch = branch ,
185
213
tag = tag ,
186
214
include_gitignored = include_gitignored ,
0 commit comments