Skip to content

Commit 64cffb2

Browse files
author
Jet Xu
committed
Vibe Coding enhancement
1 parent cf6433f commit 64cffb2

44 files changed

Lines changed: 2374 additions & 2331 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE.md

Whitespace-only changes.

.github/workflows/publish.yml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,22 @@ jobs:
1010
permissions:
1111
id-token: write
1212
steps:
13-
- uses: actions/checkout@v3
14-
- name: Set up Python
15-
uses: actions/setup-python@v4
16-
with:
17-
python-version: '3.x'
18-
- name: Install dependencies
19-
run: |
20-
python -m pip install --upgrade pip
21-
pip install setuptools wheel
22-
- name: Build package
23-
run: python setup.py sdist bdist_wheel
24-
- name: List distribution files
25-
run: ls -l dist/
26-
- name: Publish package
27-
uses: pypa/gh-action-pypi-publish@release/v1
28-
with:
29-
packages-dir: dist/
13+
- uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.12"
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install -e .[dev]
22+
- name: Run tests
23+
run: pytest -q
24+
- name: Build package
25+
run: python -m build
26+
- name: List distribution files
27+
run: ls -l dist/
28+
- name: Publish package
29+
uses: pypa/gh-action-pypi-publish@release/v1
30+
with:
31+
packages-dir: dist/

.github/workflows/secret-scan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- name: Checkout code
10-
uses: actions/checkout@v3
10+
uses: actions/checkout@v4
1111

1212
- name: Install Gitleaks
1313
run: |
14-
curl -sSL https://github.com/zricethezav/gitleaks/releases/download/v8.2.0/gitleaks_8.2.0_linux_x64.tar.gz | tar -xz -C /usr/local/bin gitleaks
14+
curl -sSL https://github.com/zricethezav/gitleaks/releases/download/v8.18.4/gitleaks_8.18.4_linux_x64.tar.gz | tar -xz -C /usr/local/bin gitleaks
1515
1616
- name: Run Gitleaks
1717
run: |

.github/workflows/tests.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python-version: ["3.10", "3.11", "3.12"]
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install -e .[dev]
23+
- name: Run tests
24+
run: pytest -q
25+
- name: Build package
26+
if: matrix.python-version == '3.12'
27+
run: python -m build

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.4.0] - 2026-03-25
9+
10+
### Changed
11+
- Modernized packaging to `pyproject.toml` and raised the runtime floor to Python 3.10+
12+
- Reworked LLM and GitHub integration layers to reduce stale compatibility paths and deprecated APIs
13+
- Updated repository retrieval docs to reflect the actual return shapes and maintenance-focused project positioning
14+
15+
### Fixed
16+
- Corrected `simple_mode` behavior so it no longer depends on embedding and reranker initialization
17+
- Fixed message composition order for chat history vs context handling
18+
- Stabilized test execution and added runnable mock/real examples
19+
820
## [0.3.3] - 2025-08-24
921

1022
### Optimized

CONTRIBUTING.md

Lines changed: 24 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,46 @@
11
# Contributing to llama-github
22

3-
Thank you for your interest in contributing to the llama-github project! We welcome contributions from the community to help improve and enhance the library. This document outlines the guidelines and best practices for contributing to the project.
3+
Thank you for your interest in contributing to `llama-github`.
44

55
## Code of Conduct
66

77
By participating in this project, you agree to abide by the [Code of Conduct](CODE_OF_CONDUCT.md). Please read and follow the guidelines to ensure a welcoming and inclusive environment for all contributors.
88

9-
## Getting Started
10-
11-
To get started with contributing to llama-github, follow these steps:
12-
13-
1. Fork the repository on GitHub.
14-
2. Clone your forked repository to your local machine.
15-
3. Create a new branch for your feature or bug fix.
16-
4. Make your changes and commit them with descriptive commit messages.
17-
5. Push your changes to your forked repository.
18-
6. Submit a pull request to the main repository.
19-
209
## Development Setup
2110

22-
To set up the development environment for llama-github, follow these steps:
23-
24-
1. Ensure you have Python 3.6 or above installed on your system.
25-
2. Create a virtual environment for the project.
26-
3. Install the required dependencies by running `pip install -r requirements.txt`.
27-
4. Install the development dependencies by running `pip install -r requirements-dev.txt`.
28-
5. Run the tests to ensure everything is set up correctly by executing `pytest`.
29-
30-
## Contribution Guidelines
11+
Requirements:
3112

32-
When contributing to llama-github, please keep the following guidelines in mind:
13+
- Python `3.10+`
3314

34-
- Follow the [PEP 8](https://www.python.org/dev/peps/pep-0008/) style guide for Python code.
35-
- Write clear and concise commit messages that describe the changes made.
36-
- Include tests for any new functionality or bug fixes.
37-
- Update the documentation, including docstrings and README, if necessary.
38-
- Ensure that your changes do not introduce any breaking changes unless discussed and approved by the maintainers.
39-
- Be respectful and constructive in all interactions with other contributors.
15+
Setup:
4016

41-
## Issue Tracking
17+
```bash
18+
python -m venv .venv
19+
source .venv/bin/activate
20+
pip install -e .[dev]
21+
```
4222

43-
If you encounter a bug, have a feature request, or want to discuss an improvement, please submit an issue on the [GitHub issue tracker](https://github.com/JetXu-LLM/llama-github/issues). When submitting an issue, provide as much detail as possible, including steps to reproduce the problem or a clear description of the proposed feature.
23+
Validation:
4424

45-
## Pull Request Process
25+
```bash
26+
pytest -q
27+
python -m build
28+
```
4629

47-
When submitting a pull request, please follow these steps:
30+
## Guidelines
4831

49-
1. Ensure that your changes are based on the latest version of the main branch.
50-
2. Provide a clear and descriptive title for your pull request.
51-
3. Include a detailed description of the changes made and the problem they solve or the feature they add.
52-
4. Reference any related issues or pull requests using the `#` symbol followed by the issue or pull request number.
53-
5. Ensure that all tests pass and that your changes do not introduce any new warnings or errors.
54-
6. Be prepared to address any feedback or requests for changes during the code review process.
32+
- Keep public API changes intentional and well documented.
33+
- Add or update tests for behavioral changes.
34+
- Update docs when changing return shapes, examples, or supported runtime versions.
35+
- Prefer small, reviewable pull requests over broad rewrites.
5536

56-
## Code Review
37+
## Pull Requests
5738

58-
All pull requests will be reviewed by the project maintainers. During the review process, the maintainers may provide feedback, request changes, or ask for clarification. Please be responsive to the feedback and address any requested changes in a timely manner.
39+
- Use a clear title and description.
40+
- Include migration notes when behavior changes in a user-visible way.
41+
- Reference related issues when applicable.
42+
- Make sure the repository still passes `pytest -q` and `python -m build`.
5943

6044
## License
6145

6246
By contributing to llama-github, you agree that your contributions will be licensed under the [Apache License 2.0](LICENSE).
63-
64-
## Recognition
65-
66-
We value and appreciate all contributions to the llama-github project. Your contributions will be recognized in the project's release notes and contributor list.
67-
68-
## Contact
69-
70-
If you have any questions or need further assistance, feel free to reach out to the project maintainers at [Voldemort.xu@foxmail.com](mailto:Voldemort.xu@foxmail.com).
71-
72-
Thank you for your contributions and happy coding!

README.md

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
1-
2-
<div align="right">
3-
<details>
4-
<summary >🌐 Language</summary>
5-
<div>
6-
<div align="center">
7-
<a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=en">English</a>
8-
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=zh-CN">简体中文</a>
9-
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=zh-TW">繁體中文</a>
10-
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=ja">日本語</a>
11-
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=ko">한국어</a>
12-
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=hi">हिन्दी</a>
13-
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=th">ไทย</a>
14-
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=fr">Français</a>
15-
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=de">Deutsch</a>
16-
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=es">Español</a>
17-
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=it">Italiano</a>
18-
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=ru">Русский</a>
19-
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=pt">Português</a>
20-
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=nl">Nederlands</a>
21-
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=pl">Polski</a>
22-
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=ar">العربية</a>
23-
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=fa">فارسی</a>
24-
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=tr">Türkçe</a>
25-
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=vi">Tiếng Việt</a>
26-
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=id">Bahasa Indonesia</a>
27-
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=as">অসমীয়া</
28-
</div>
29-
</div>
30-
</details>
1+
2+
<div align="right">
3+
<details>
4+
<summary >🌐 Language</summary>
5+
<div>
6+
<div align="center">
7+
<a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=en">English</a>
8+
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=zh-CN">简体中文</a>
9+
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=zh-TW">繁體中文</a>
10+
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=ja">日本語</a>
11+
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=ko">한국어</a>
12+
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=hi">हिन्दी</a>
13+
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=th">ไทย</a>
14+
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=fr">Français</a>
15+
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=de">Deutsch</a>
16+
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=es">Español</a>
17+
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=it">Italiano</a>
18+
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=ru">Русский</a>
19+
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=pt">Português</a>
20+
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=nl">Nederlands</a>
21+
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=pl">Polski</a>
22+
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=ar">العربية</a>
23+
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=fa">فارسی</a>
24+
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=tr">Türkçe</a>
25+
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=vi">Tiếng Việt</a>
26+
| <a href="https://openaitx.github.io/view.html?user=JetXu-LLM&project=llama-github&lang=id">Bahasa Indonesia</a>
27+
</div>
28+
</div>
29+
</details>
3130
</div>
3231

3332
# llama-github
@@ -50,6 +49,8 @@ If you like this project or believe it has potential, please give it a ⭐️. Y
5049
pip install llama-github
5150
```
5251

52+
Current maintained runtime target: Python `3.10+`.
53+
5354
## Usage
5455

5556
Here's a simple example of how to use llama-github:
@@ -66,29 +67,32 @@ github_rag = GithubRAG(
6667

6768
# Retrieve context for a coding question (simple_mode is default set to False)
6869
query = "How to create a NumPy array in Python?"
69-
context = github_rag.retrieve_context(
70-
query, # In professional mode, one query will take nearly 1 min to generate final contexts. You could set log level to INFO to monitor the retrieval progress
70+
contexts = github_rag.retrieve_context(
71+
query,
7172
# simple_mode = True
7273
)
7374

74-
print(context)
75+
print(contexts[0]["url"])
76+
print(contexts[0]["context"])
7577
```
7678

77-
For more advanced usage and examples, please refer to the [documentation](docs/usage.md).
79+
`retrieve_context()` returns a list of context dictionaries. Each item contains at least `context` and `url`.
80+
81+
For more advanced usage and examples, please refer to the [documentation](docs/usage.md). Runnable low-cost examples are also available in [`examples/`](examples).
7882

7983
## Key Features
8084

8185
- **🔍 Intelligent GitHub Retrieval**: Harness the power of llama-github to retrieve highly relevant code snippets, issues, and repository information from GitHub based on user queries. Our advanced retrieval techniques ensure you find the most pertinent information quickly and efficiently.
8286

83-
- **⚡ Repository Pool Caching**: Llama-github has an innovative repository pool caching mechanism. By caching repositories (including READMEs, structures, code, and issues) across threads, llama-github significantly accelerates GitHub search retrieval efficiency and minimizes the consumption of GitHub API tokens. Deploy llama-github in multi-threaded production environments with confidence, knowing that it will perform optimally and save you valuable resources.
87+
- **⚡ Repository Pool Caching**: Llama-github has an innovative repository pool caching mechanism. By caching repositories (including READMEs, structures, code, and issues) across threads, llama-github significantly accelerates GitHub search retrieval efficiency and minimizes the consumption of GitHub API tokens.
8488

8589
- **🧠 LLM-Powered Question Analysis**: Leverage state-of-the-art language models to analyze user questions and generate highly effective search strategies and criteria. Llama-github intelligently breaks down complex queries, ensuring that you retrieve the most relevant information from GitHub's vast repository network.
8690

8791
- **📚 Comprehensive Context Generation**: Generate rich, contextually relevant answers by seamlessly combining information retrieved from GitHub with the reasoning capabilities of advanced language models. Llama-github excels at handling even the most complex and lengthy questions, providing comprehensive and insightful responses that include extensive context to support your development needs.
8892

89-
- **🚀 Asynchronous Processing Excellence**: Llama-github is built from the ground up to leverage the full potential of asynchronous programming. With meticulously implemented asynchronous mechanisms woven throughout the codebase, llama-github can handle multiple requests concurrently, significantly boosting overall performance. Experience the difference as llama-github efficiently manages high-volume workloads without compromising on speed or quality.
93+
- **🚀 Asynchronous Processing Excellence**: Llama-github is built from the ground up to leverage the full potential of asynchronous programming. With meticulously implemented asynchronous mechanisms woven throughout the codebase, llama-github can handle multiple requests concurrently, significantly boosting overall performance.
9094

91-
- **🔧 Flexible LLM Integration**: Easily integrate llama-github with various LLM providers, embedding models, and reranking models to tailor the library's capabilities to your specific requirements. Our extensible architecture allows you to customize and enhance llama-github's functionality, ensuring that it adapts seamlessly to your unique development environment.
95+
- **🔧 Flexible LLM Integration**: Easily integrate llama-github with various LLM providers, embedding models, reranking models, or an injected LangChain-compatible chat model to tailor the library's capabilities to your specific requirements.
9296

9397
- **🔒 Robust Authentication Options**: Llama-github supports both personal access tokens and GitHub App authentication, providing you with the flexibility to integrate it into different development setups. Whether you're an individual developer or working within an organizational context, llama-github has you covered with secure and reliable authentication mechanisms.
9498

@@ -120,7 +124,7 @@ Our vision is to become a pivotal module in the future of AI-driven development
120124

121125
### Roadmap
122126

123-
For a detailed view of our project roadmap, please visit our [Project Roadmap](https://github.com/users/JetXu-LLM/projects/2).
127+
For a historical view of the earlier roadmap, please visit [Vision and Roadmap](VISION_AND_ROADMAP.md).
124128

125129
## Acknowledgments
126130

0 commit comments

Comments
 (0)