Module Summarization¶
create_module_summary(name, file_summaries, submodule_summaries, chat_engine)
¶
Combines file and submodule summaries to generate a concise overview of the module's content.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the module. |
required |
file_summaries
|
List[str]
|
A list of strings, where each string is a summary of a file in the module. |
required |
submodule_summaries
|
List[str]
|
A list of strings, where each string is a summary of a submodule. |
required |
chat_engine
|
An instance of a chat engine used for summarizing the module content. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The summarized module content as a string. |
Source code in repo_agent/module_summarization.py
summarize_repository(root_dir, repo_structure, chat_engine)
¶
Recursively generates summaries for each directory within a repository, identifying and summarizing Python files based on their structure and content. It handles ignored folders and consolidates summaries to provide an overview of each module and its submodules.
This function recursively traverses the directory structure of a given repository, identifies Python files, and generates summaries based on the provided repository structure and chat engine. It also handles ignored folders as specified in the settings. The tool is part of a comprehensive system designed to automate the generation and management of documentation for a Git repository, ensuring that documentation is up-to-date and accurate.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
root_dir
|
str
|
The root directory of the repository. |
required |
repo_structure
|
Dict[str, Any]
|
A dictionary containing the structure of the repository, mapping file paths to their respective components. |
required |
chat_engine
|
Any
|
The chat engine used to generate summaries. |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dict[str, Any]: A dictionary containing the summary of the repository, including the name, path, file summaries, submodules, and module summary for each directory. |
Raises:
Type | Description |
---|---|
ValueError
|
If the root directory does not exist or is not a valid directory. |
Note
See also: The summarize_modules
method in the Runner
class for an example of how this function is used in a workflow.