Skip to content

Commit

Permalink
docs: update image URLs in README and README_CN
Browse files Browse the repository at this point in the history
- Bump version to v0.1.3
- Add release.yml for upload release to PyPI.
  • Loading branch information
Umpire2018 committed Mar 11, 2024
1 parent 0fbf179 commit be62d4e
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 27 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release

on:
release:
types: [published]

jobs:
pypi-publish:
name: upload release to PyPI
runs-on: ubuntu-latest
permissions:
# This permission is needed for private repositories.
contents: read
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v3

- uses: pdm-project/setup-pdm@v3

- name: Publish package distributions to PyPI
run: pdm publish
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</p>

<p align="center">
<img src="assets/images/RepoAgent.png" alt="RepoAgent"/>
<img src="https://raw.githubusercontent.com/OpenBMB/RepoAgent/main/assets/images/RepoAgent.png" alt="RepoAgent"/>
</p>

<p align="center">
Expand Down Expand Up @@ -194,11 +194,11 @@ You just need to follow the normal git workflow: git add, git commit -m "your co
The RepoAgent hook will automatically trigger at git commit, detect the files you added in the previous step, and generate corresponding documents.

After execution, RepoAgent will automatically modify the staged files in the target repository and formally submit the commit. After the execution is completed, the green "Passed" will be displayed, as shown in the figure below:
![Execution Result](assets/images/ExecutionResult.png)
![Execution Result](https://raw.githubusercontent.com/OpenBMB/RepoAgent/main/assets/images/ExecutionResult.png)

The generated document will be stored in the specified folder in the root directory of the target warehouse. The rendering of the generated document is as shown below:
![Documentation](assets/images/Doc_example.png)
![Documentation](assets/images/8_documents.png)
![Documentation](https://raw.githubusercontent.com/OpenBMB/RepoAgent/main/assets/images/Doc_example.png)
![Documentation](https://raw.githubusercontent.com/OpenBMB/RepoAgent/main/assets/images/8_documents.png)

We utilized the default model **gpt-3.5-turbo** to generate documentation for the [**XAgent**](https://github.com/OpenBMB/XAgent) project, which comprises approximately **270,000 lines** of code. You can view the results of this generation in the Markdown_Docs directory of the XAgent project on GitHub. For enhanced documentation quality, we suggest considering more advanced models like **gpt-4-1106** or **gpt-4-0125-preview**.

Expand All @@ -216,7 +216,6 @@ repoagent chat-with-repo

## ✅ Future Work

- [x] Support install and configure via `pip install repoagent`
- [ ] Generate README.md automatically combining with the global documentation
- [ ] **Multi-programming-language support** Support more programming languages like Java, C or C++, etc.
- [ ] Local model support like Llama, chatGLM, Qwen, GLM4, etc.
Expand Down
8 changes: 4 additions & 4 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</p>

<p align="center">
<img src="assets/images/RepoAgent.png" alt="RepoAgent"/>
<img src="https://raw.githubusercontent.com/OpenBMB/RepoAgent/main/assets/images/RepoAgent.png" alt="RepoAgent"/>
</p>

<p align="center">
Expand Down Expand Up @@ -188,11 +188,11 @@ pre-commit install
RepoAgent hook会在git commit时自动触发,检测前一步您git add的文件,并生成对应的文档。

执行后,RepoAgent会自动更改目标仓库中的已暂存文件并正式提交commit,执行完毕后会显示绿色的Passed,如下图所示:
![Execution Result](assets/images/ExecutionResult.png)
![Execution Result](https://raw.githubusercontent.com/OpenBMB/RepoAgent/main/assets/images/ExecutionResult.png)

生成的文档将存放在目标仓库根目录下的指定文件夹中,生成的文档效果如下图所示:
![Documentation](assets/images/Doc_example.png)
![Documentation](assets/images/8_documents.png)
![Documentation](https://raw.githubusercontent.com/OpenBMB/RepoAgent/main/assets/images/Doc_example.png)
![Documentation](https://raw.githubusercontent.com/OpenBMB/RepoAgent/main/assets/images/8_documents.png)


我们使用默认模型**gpt-3.5-turbo**对一个约**27万行**的中大型项目[**XAgent**](https://github.com/OpenBMB/XAgent)生成了文档。您可以前往XAgent项目的Markdown_Docs文件目录下查看生成效果。如果您希望得到更好的文档效果,我们建议您使用更先进的模型,如**gpt-4-1106****gpt-4-0125-preview**
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ dependencies = [
"llama-index<0.10.0",
]
name = "repoagent"
version = "0.1.2"
version = "0.1.3"
description = "An LLM-Powered Framework for Repository-level Code Documentation Generation."
readme = "README.md"
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Artificial Intelligence"
"Topic :: Scientific/Engineering :: Artificial Intelligence"
]

[project.urls]
Expand All @@ -54,7 +54,6 @@ test = [
[tool.pdm.build]
includes = [
"repo_agent",
"assets/images/*.png"
]


Expand Down
37 changes: 22 additions & 15 deletions repo_agent/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,29 @@ def get_all_pys(self, directory):

def generate_doc_for_a_single_item(self, doc_item: DocItem):
"""为一个对象生成文档"""
rel_file_path = doc_item.get_full_name()
try:

rel_file_path = doc_item.get_full_name()

if not need_to_generate(doc_item, setting.project.ignore_list):
print(f"Content ignored/Document generated, skipping: {doc_item.get_full_name()}")
else:
print(f" -- Generating document {Fore.LIGHTYELLOW_EX}{doc_item.item_type.name}: {doc_item.get_full_name()}{Style.RESET_ALL}")
file_handler = FileHandler(setting.project.target_repo, rel_file_path)
response_message = self.chat_engine.generate_doc(
doc_item=doc_item,
file_handler=file_handler,
)
doc_item.md_content.append(response_message.content)
doc_item.item_status = DocItemStatus.doc_up_to_date
self.meta_info.checkpoint(
target_dir_path=self.absolute_project_hierarchy_path
)
except Exception as e:
logger.info(f"Document generation failed after multiple attempts, skipping: {doc_item.get_full_name()}")
logger.error("Error:", e)
doc_item.item_status = DocItemStatus.doc_has_not_been_generated

if not need_to_generate(doc_item, setting.project.ignore_list):
print(f"Content ignored/Document generated, skipping: {doc_item.get_full_name()}")
else:
print(f" -- Generating document {Fore.LIGHTYELLOW_EX}{doc_item.item_type.name}: {doc_item.get_full_name()}{Style.RESET_ALL}")
file_handler = FileHandler(setting.project.target_repo, rel_file_path)
response_message = self.chat_engine.generate_doc(
doc_item=doc_item,
file_handler=file_handler,
)
doc_item.md_content.append(response_message.content)
doc_item.item_status = DocItemStatus.doc_up_to_date
self.meta_info.checkpoint(
target_dir_path=self.absolute_project_hierarchy_path
)

def first_generate(self):
"""
Expand Down

0 comments on commit be62d4e

Please sign in to comment.