An AI-based assistant for handling github issues and pull-requests
Project description
git-bob
git-bob uses AI to solve Github-issues and review pull-requests. It runs inside the Github CI, no need to install anything on your computer.
Under the hood it uses Anthropic's Claude or OpenAI's chatGPT to understand the text and pygithub to interact with the issues and pull-requests.
Disclaimer
git-bob
is a research project aiming at streamlining Github interaction in software development projects. Under the hood it uses
artificial intelligence / large language models to generate text and code fulfilling the user's requests.
Users are responsible to verify the generated code according to good scientific practice.
When using git-bob
you configure it to use an API key to access the AI models.
You have to pay for the usage and must be careful in using the software.
Do not use this technology if you are not aware of the costs and consequences.
[!CAUTION] When using the Anthropic, OpenAI or any other endpoint via git-bob, you are bound to the terms of service of the respective companies or organizations. The github issues, pull-requests and messages you enter are transferred to their servers and may be processed and stored there. Make sure to not submit any sensitive, confidential or personal data. Also using these services may cost money.
Installation as Github action
There is a detailed tutorial on how to install git-bob as github action to your repository. In very short, to use git-bob in your Github repository, you need to
- setup Github workflows like shown in this folder.
- Make sure to replace
pip install -e .
with a specific git-bob version such aspip install git-bob==0.2.2
. - Configure the LLM you want to use in the workflow files by specifying the
GIT_BOB_LLM_NAME
environment variable. These were tested:
- Make sure to replace
claude-3-5-sonnet-20240620
gpt-4o-2024-08-06
(recommended if you work with large files, < 16k tokens)
- configure a Github secret called
OPENAI_API_KEY
orANTHROPIC_API_KEY
with the corresponding key from the LLM provider depending on the above configured LLM. You can get these keys here: - configure Github actions to run the workflow on issues and pull-requests. Also give write-access to the Workflow using the
GITHUB_TOKEN
.
To trigger git-bob, you need to comment on an issue or pull-request with the following command:
git-bob comment
If the issue is complex and should be split into sub-issues, you can use the following command:
git-bob split
You can also use the following command to trigger git-bob solving an issue. It will then try to solve the issue and send a pull-request.
git-bob solve
Recommended Workflow
Here's the recommended workflow for using git-bob:
- Create an issue describing the problem or task.
- Comment on the issue with
git-bob comment
, orgit-bob think about this
(an alias forcomment
) to trigger git-bob making a plan. - Respond to git-bob with any clarifications or additional information it requests.
- Comment on the issue with
git-bob solve
orgit-bob implement this
(an alias forsolve
) to trigger git-bob. - Wait for git-bob to create a pull request (PR) addressing the issue.
- Review the PR and comment on the issue if changes are needed.
- Wait for git-bob to create a second PR with the requested changes.
- Repeat steps 3-5 as necessary until the issue is resolved satisfactorily.
Use-case examples
Solving github issues
git-bob
can fix typos (issue, pull-request):
git-bob
can improve code documentation (issue, pull-request):
Review Pull-Requests
git-bob
can review pull-requests and provide feedback (pull-request):
Splitting Issues
To split a main issue into sub-issues, ask git-bob split this issue
.
General prompting
git-bob
can also be exploited to answer questions (issue).
Installation as command-line tool
You can also install git-bob locally and run it from the terminal.
In this case, create a Github token and store it in an environment variable named GITHUB_API_KEY
.
Also create an environment variable GIT_BOB_LLM_NAME
with the name of the LLM you want to use, e.g. "gpt-4o-2024-05-13" or "claude-3-5-sonnet-20240620".
Then you can install git-bob using pip:
pip install git-bob
Usage as command-line tool
You can then use git-bob from the terminal on repositories you have read/write access to.
git-bob <action> <organization>/<repository> <issue-number>
Available actions:
review-pull-request
comment-on-issue
solve-issue
split-issue
Limitations
git-bob
is a research project and has limitations. It serves as basis for discussion and further development. Once LLMs become better, git-bob
will become better as well.
At the moment, these limitations can be observed:
git-bob
was tested for Python projects only (yet).- It sometimes halucinates, especially in code reviews. E.g. it claimed to have tested code, which is certainly not true.
- It cannot solve issues where changing long files is required, as the output of the LLMs is limited by a maximum number of tokens (e.g. 16k for
gpt-4o-2024-08-06
). - It cannot solve issues where running and testing the code is required.
- When changing multiple files, it may introduce conflicts between the files, as it does not know about the content of the other files.
- It has only limited logic to control who is allowed to trigger it. If you are a repository member, you can trigger it. If others send a pull-request, a repository member must allow the action to run manually.
git-bob
is incompatible with locally running open-source/-weight LLMs. This might make sense when being executed locally only. In the Github-CI this might be impossible.- Recently tested
claude-3-5-sonnet-20240620
andgpt-4o-2024-08-06
models produce useful results. The modelgemini-1.5-flash-001
is technically supported too, but its results were not very useful.
Similar projects
There are similar projects out there
Contributing
Feedback and contributions are welcome! Just open an issue and let's discuss before you send a pull-request. A human will respond and comment on your ideas!
Acknowledgements
We acknowledge the financial support by the Federal Ministry of Education and Research of Germany and by Sächsische Staatsministerium für Wissenschaft, Kultur und Tourismus in the programme Center of Excellence for AI-research „Center for Scalable Data Analytics and Artificial Intelligence Dresden/Leipzig", project identification number: ScaDS.AI
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file git_bob-0.2.6.tar.gz
.
File metadata
- Download URL: git_bob-0.2.6.tar.gz
- Upload date:
- Size: 24.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15505698b93a5d56d8d5b252e98f0e62268ef92bc3a94af7953e0855ddd022d5 |
|
MD5 | c2feef5b68ef368c442c2903df8ebd0b |
|
BLAKE2b-256 | c042c3ef11bb7cd86c6231250eff3e7845970877b01df77374f2bcd9b6ab2d49 |
File details
Details for the file git_bob-0.2.6-py3-none-any.whl
.
File metadata
- Download URL: git_bob-0.2.6-py3-none-any.whl
- Upload date:
- Size: 21.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cff96510375e1b77a198f7c103078f40b9d07692a1f59dd4cdb024f7b8470bf |
|
MD5 | e892e7c581a831e6cef7a17f3c543867 |
|
BLAKE2b-256 | de8bcb3eaea3c246648c4479a9c56b95ac412f7b42db894c1db4287048387ea5 |