Skip to content

Commit

Permalink
Merge pull request #403 from haesleinhuepf/triggers
Browse files Browse the repository at this point in the history
New trigger words + better documentation
  • Loading branch information
haesleinhuepf authored Oct 22, 2024
2 parents 00f3c5d + 5d4deb6 commit 3ca50f7
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 16 deletions.
36 changes: 21 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# 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.
Read more in the [preprint](https://doi.org/10.5281/zenodo.13928832).
Read more in the [preprint](https://doi.org/10.5281/zenodo.13928832).

![demo_fix_typos.png](docs/images/banner.png)
![banner](https://github.com/haesleinhuepf/git-bob/raw/main/docs/images/banner2.png)

Under the hood it uses [Anthropic's Claude](https://www.anthropic.com/api) or [OpenAI's chatGPT](https://openai.com/blog/openai-api) or [Google's Gemini](https://blog.google/technology/ai/google-gemini-ai/) to understand the text and
[pygithub](https://github.com/PyGithub/PyGithub) to interact with the issues and pull requests.
[pygithub](https://github.com/PyGithub/PyGithub) to interact with the issues and pull requests. As its discussions are conserved, you can document how things were done using AI and
others can learn how to prompt for the things you did. For example, the pair-plot discussion above is [available online](https://github.com/haesleinhuepf/git-bob-playground/issues/48).

## Disclaimer

Expand Down Expand Up @@ -59,37 +60,36 @@ Furthermore, to guide discussions, you may want to setup issue templates, e.g.

Since version 0.10.1 git-bob has experimental support for [gitlab](https://gitlab.com). You find detailed instructions how to install it [here](docs/installation-tutorial-gitlab.md).

## Usage
## Usage: Trigger words

To trigger git-bob, you need to comment on an issue or pull request with the following command:
To trigger git-bob, you need to comment on an issue or pull request with the `comment` trigger word (or aliases `think about`, `review`, `respond`):

```
git-bob comment
```

If the issue is complex and should be split into sub-issues, you can use the following command:
After some back-and-forth discussion, you can also use the `solve` trigger word (or aliases `implement`, `apply`) make git-bob solve an issue and send a pull-request.
This trigger can also be used to modify code in pull requests.

```
git-bob split
git-bob solve
```

You can ask git-bob to implement a solution, e.g. as Jupyter notebook and run it like this:
You can ask git-bob to implement a solution for testing, without sending a pull-request, using the `try` trigger:
```
git-bob try
```

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.
This action can also be used to modify code in pull requests.
If you have multiple API-Key for different LLMs configured, you can specify the LLM in the command using the `ask <LLM-Name> to` trigger command:

```
git-bob solve
git-bob ask claude-3-5-sonnet-20240620 to solve this issue.
```

If you have multiple API-Key for different LLMs configured, you can specify the LLM in the command, e.g.:
If the issue is complex and should be split into sub-issues, you can use the following command:

```
git-bob ask claude-3-5-sonnet-20240620 to solve this issue.
git-bob split
```

If you have two GitHub secrets `TWINE_USERNAME` and `TWINE_PASSWORD` configured, you can also use the following command to publish a new version of your library to PyPI:
Expand All @@ -98,6 +98,12 @@ If you have two GitHub secrets `TWINE_USERNAME` and `TWINE_PASSWORD` configured,
git-bob deploy
```

All trigger words can be combined with `please` and/or `,`, which will make no difference to calling git-bob without these words:

```
git-bob, please ask gemini-1.5-pro-002 to solve this issue.
```

## Recommended Workflow

Here's the recommended workflow for using git-bob:
Expand Down Expand Up @@ -135,7 +141,7 @@ Some were parts of real scientific data analysis projects.
* [Violing plots with simulated data](https://github.com/haesleinhuepf/git-bob-playground/issues/44)
* [UMAPs with simulated data](https://github.com/haesleinhuepf/git-bob-playground/issues/41)
* [Plotting a circle of triangles (in gitlab)](https://gitlab.com/haesleinhuepf/git-bob-gitlab-playground/-/issues/8)
* [Pairplots with simulated data](https://github.com/haesleinhuepf/git-bob-playground/issues/46)
* [Pairplots with simulated data](https://github.com/haesleinhuepf/git-bob-playground/issues/48)

## Installation for development

Expand Down
Binary file removed docs/images/banner.png
Binary file not shown.
Binary file added docs/images/banner2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/git_bob/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.11.0"
__version__ = "0.11.1"

__all__ = (
)
2 changes: 2 additions & 0 deletions src/git_bob/_terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,13 @@ def handler(signum, frame):
Log().log("Using language model: _" + Config.llm_name[1:])

text = text.replace(f"{agent_name}, ", f"{agent_name} ")
text = text.replace(f"{agent_name} please ", f"{agent_name} ")

# aliases for comment action
text = text.replace(f"{agent_name} respond", f"{agent_name} comment")
text = text.replace(f"{agent_name} review", f"{agent_name} comment")
text = text.replace(f"{agent_name} think about", f"{agent_name} comment")
text = text.replace(f"{agent_name} answer", f"{agent_name} comment")

# aliases for solve action
text = text.replace(f"{agent_name} implement", f"{agent_name} solve")
Expand Down

0 comments on commit 3ca50f7

Please sign in to comment.