@@ -33,8 +33,11 @@ async def ingest_async(
3333 source : str ,
3434 * ,
3535 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 ,
3739 exclude_patterns : str | set [str ] | None = None ,
40+ include_patterns : str | set [str ] | None = None ,
3841 branch : str | None = None ,
3942 tag : str | None = None ,
4043 include_gitignored : bool = False ,
@@ -51,17 +54,23 @@ async def ingest_async(
5154 Parameters
5255 ----------
5356 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 .
5558 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).
5966 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.
6170 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).
6372 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.
6574 include_gitignored : bool
6675 If ``True``, include files ignored by ``.gitignore`` and ``.gitingestignore`` (default: ``False``).
6776 include_submodules : bool
@@ -70,7 +79,7 @@ async def ingest_async(
7079 GitHub personal access token (PAT) for accessing private repositories.
7180 Can also be set via the ``GITHUB_TOKEN`` environment variable.
7281 output : str | None
73- File path where the summary and content should be written.
82+ File path where the summary and content is written.
7483 If ``"-"`` (dash), the results are written to ``stdout``.
7584 If ``None``, the results are not written to a file.
7685
@@ -107,6 +116,13 @@ async def ingest_async(
107116 if query .url :
108117 _override_branch_and_tag (query , branch = branch , tag = tag )
109118
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+
110126 query .include_submodules = include_submodules
111127
112128 async with _clone_repo_if_remote (query , token = token ):
@@ -121,8 +137,11 @@ def ingest(
121137 source : str ,
122138 * ,
123139 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 ,
125143 exclude_patterns : str | set [str ] | None = None ,
144+ include_patterns : str | set [str ] | None = None ,
126145 branch : str | None = None ,
127146 tag : str | None = None ,
128147 include_gitignored : bool = False ,
@@ -139,17 +158,23 @@ def ingest(
139158 Parameters
140159 ----------
141160 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 .
143162 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).
147170 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.
149174 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).
151176 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.
153178 include_gitignored : bool
154179 If ``True``, include files ignored by ``.gitignore`` and ``.gitingestignore`` (default: ``False``).
155180 include_submodules : bool
@@ -158,7 +183,7 @@ def ingest(
158183 GitHub personal access token (PAT) for accessing private repositories.
159184 Can also be set via the ``GITHUB_TOKEN`` environment variable.
160185 output : str | None
161- File path where the summary and content should be written.
186+ File path where the summary and content is written.
162187 If ``"-"`` (dash), the results are written to ``stdout``.
163188 If ``None``, the results are not written to a file.
164189
@@ -179,8 +204,11 @@ def ingest(
179204 ingest_async (
180205 source = source ,
181206 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 ,
183210 exclude_patterns = exclude_patterns ,
211+ include_patterns = include_patterns ,
184212 branch = branch ,
185213 tag = tag ,
186214 include_gitignored = include_gitignored ,
0 commit comments