Skip to content

Commit be62d4e

Browse files
committed
docs: update image URLs in README and README_CN
- Bump version to v0.1.3 - Add release.yml for upload release to PyPI.
1 parent 0fbf179 commit be62d4e

File tree

5 files changed

+54
-27
lines changed

5 files changed

+54
-27
lines changed

.github/workflows/release.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
pypi-publish:
9+
name: upload release to PyPI
10+
runs-on: ubuntu-latest
11+
permissions:
12+
# This permission is needed for private repositories.
13+
contents: read
14+
# IMPORTANT: this permission is mandatory for trusted publishing
15+
id-token: write
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- uses: pdm-project/setup-pdm@v3
20+
21+
- name: Publish package distributions to PyPI
22+
run: pdm publish

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</p>
1818

1919
<p align="center">
20-
<img src="assets/images/RepoAgent.png" alt="RepoAgent"/>
20+
<img src="https://raw.githubusercontent.com/OpenBMB/RepoAgent/main/assets/images/RepoAgent.png" alt="RepoAgent"/>
2121
</p>
2222

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

196196
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:
197-
![Execution Result](assets/images/ExecutionResult.png)
197+
![Execution Result](https://raw.githubusercontent.com/OpenBMB/RepoAgent/main/assets/images/ExecutionResult.png)
198198

199199
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:
200-
![Documentation](assets/images/Doc_example.png)
201-
![Documentation](assets/images/8_documents.png)
200+
![Documentation](https://raw.githubusercontent.com/OpenBMB/RepoAgent/main/assets/images/Doc_example.png)
201+
![Documentation](https://raw.githubusercontent.com/OpenBMB/RepoAgent/main/assets/images/8_documents.png)
202202

203203
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**.
204204

@@ -216,7 +216,6 @@ repoagent chat-with-repo
216216

217217
## ✅ Future Work
218218

219-
- [x] Support install and configure via `pip install repoagent`
220219
- [ ] Generate README.md automatically combining with the global documentation
221220
- [ ] **Multi-programming-language support** Support more programming languages like Java, C or C++, etc.
222221
- [ ] Local model support like Llama, chatGLM, Qwen, GLM4, etc.

README_CN.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</p>
1818

1919
<p align="center">
20-
<img src="assets/images/RepoAgent.png" alt="RepoAgent"/>
20+
<img src="https://raw.githubusercontent.com/OpenBMB/RepoAgent/main/assets/images/RepoAgent.png" alt="RepoAgent"/>
2121
</p>
2222

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

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

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

197197

198198
我们使用默认模型**gpt-3.5-turbo**对一个约**27万行**的中大型项目[**XAgent**](https://github.com/OpenBMB/XAgent)生成了文档。您可以前往XAgent项目的Markdown_Docs文件目录下查看生成效果。如果您希望得到更好的文档效果,我们建议您使用更先进的模型,如**gpt-4-1106****gpt-4-0125-preview**

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ dependencies = [
2424
"llama-index<0.10.0",
2525
]
2626
name = "repoagent"
27-
version = "0.1.2"
27+
version = "0.1.3"
2828
description = "An LLM-Powered Framework for Repository-level Code Documentation Generation."
2929
readme = "README.md"
3030
classifiers = [
3131
"Programming Language :: Python :: 3",
3232
"Programming Language :: Python :: 3.10",
3333
"Programming Language :: Python :: 3.11",
3434
"Programming Language :: Python :: 3.12",
35-
"Topic :: Scientific/Engineering :: Artificial Intelligence"
35+
"Topic :: Scientific/Engineering :: Artificial Intelligence"
3636
]
3737

3838
[project.urls]
@@ -54,7 +54,6 @@ test = [
5454
[tool.pdm.build]
5555
includes = [
5656
"repo_agent",
57-
"assets/images/*.png"
5857
]
5958

6059

repo_agent/runner.py

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,29 @@ def get_all_pys(self, directory):
7070

7171
def generate_doc_for_a_single_item(self, doc_item: DocItem):
7272
"""为一个对象生成文档"""
73-
rel_file_path = doc_item.get_full_name()
73+
try:
74+
75+
rel_file_path = doc_item.get_full_name()
76+
77+
if not need_to_generate(doc_item, setting.project.ignore_list):
78+
print(f"Content ignored/Document generated, skipping: {doc_item.get_full_name()}")
79+
else:
80+
print(f" -- Generating document {Fore.LIGHTYELLOW_EX}{doc_item.item_type.name}: {doc_item.get_full_name()}{Style.RESET_ALL}")
81+
file_handler = FileHandler(setting.project.target_repo, rel_file_path)
82+
response_message = self.chat_engine.generate_doc(
83+
doc_item=doc_item,
84+
file_handler=file_handler,
85+
)
86+
doc_item.md_content.append(response_message.content)
87+
doc_item.item_status = DocItemStatus.doc_up_to_date
88+
self.meta_info.checkpoint(
89+
target_dir_path=self.absolute_project_hierarchy_path
90+
)
91+
except Exception as e:
92+
logger.info(f"Document generation failed after multiple attempts, skipping: {doc_item.get_full_name()}")
93+
logger.error("Error:", e)
94+
doc_item.item_status = DocItemStatus.doc_has_not_been_generated
7495

75-
if not need_to_generate(doc_item, setting.project.ignore_list):
76-
print(f"Content ignored/Document generated, skipping: {doc_item.get_full_name()}")
77-
else:
78-
print(f" -- Generating document {Fore.LIGHTYELLOW_EX}{doc_item.item_type.name}: {doc_item.get_full_name()}{Style.RESET_ALL}")
79-
file_handler = FileHandler(setting.project.target_repo, rel_file_path)
80-
response_message = self.chat_engine.generate_doc(
81-
doc_item=doc_item,
82-
file_handler=file_handler,
83-
)
84-
doc_item.md_content.append(response_message.content)
85-
doc_item.item_status = DocItemStatus.doc_up_to_date
86-
self.meta_info.checkpoint(
87-
target_dir_path=self.absolute_project_hierarchy_path
88-
)
8996

9097
def first_generate(self):
9198
"""

0 commit comments

Comments
 (0)