build_dependency_graph_with_ai
Builds a dependency graph of the codebase using AI.
Arguments
dependency_prompt
prompt
The prompt to use to extract dependencies and build relationships between files.
exclude_path_patterns
array
The paths to exclude from the constructed graph. This should start at the root and can end at any folder or file and can be a glob pattern with wildcards.
Allowed match patterns:
Wildcard (_): • Matches any sequence of characters (except for the directory separator, /). • Example: _.log ignores all files with the .log extension.
Double Wildcard (**): • Matches any sequence of characters, including directory separators. • Example: **/temp/** ignores all files in any temp directory at any level of the directory hierarchy including the root.
Single Character Wildcard (?): • Matches any single character. • Example: file?.txt matches file1.txt, fileA.txt, etc.
Negation (!): • Includes a pattern no matter what. Trumps other ignores. • Example: !important.log includes important.log in the result.
Directory Separator (/): • Specifies directory paths. A pattern ending with / indicates a directory. • Example: temp/ ignores the temp directory and all its contents. This is the same as temp/*
Args: exclude_patterns (List[str]): List of patterns to exclude files. files (List[str]): List of files to be filtered.
Example patterns with explanation:
"*.log": Excludes all files with the .log extension.
"/temp/": Excludes all files in any directory named 'temp' at any level.
"file?.txt": Excludes files like file1.txt, fileA.txt, etc., where ? matches any single character.
"!important.log": Ensures that important.log is included, even if it matches other exclude patterns.
"temp/": Excludes the 'temp' directory at the root and all its contents.
preferred_extensions_for_resolution
array
The preferred extensions for resolution of file paths.
cost_limit
number
The maximum cost limit as a whole dollar amount for building the dependency graph.
files_to_index
array
A list of specific files to index for building the dependency graph.
Returns
null
Does not return a value. Builds a graph in memory.
Example
Last updated