Skip to content

Commit

Permalink
docs: renamed webui.rst to server.rst, added bot.md to index and upda…
Browse files Browse the repository at this point in the history
…ted instructions
  • Loading branch information
ErikBjare committed Sep 2, 2024
1 parent de9844d commit 18b7268
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 26 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ on:
issue_comment:
types: [created]

env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

# Set permissions on GITHUB_TOKEN
# It seems we cannot set `workflows: write`, yet it's needed to allow modifying workflow files
#permissions:
Expand Down
49 changes: 31 additions & 18 deletions docs/bot.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,44 @@ The action has the following inputs:

## Usage

To use the `gptme-bot` composite action in your workflow, include it as a step:
To use the `gptme-bot` composite action in your repo, you need to create a GitHub Actions workflow file that triggers the action in response to comments on issues or pull requests.

Here is an example workflow file that triggers the action in response to comments on issues:

```yaml
name: gptme-bot

on:
issue_comment:
types: [created]

steps:
- name: Run gptme-bot composite action
uses: ./.github/actions/bot-composite
with:
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
github_token: ${{ github.token }}
issue_number: ${{ github.event.issue.number }}
comment_body: ${{ github.event.comment.body }}
comment_id: ${{ github.event.comment.id }}
repo_name: ${{ github.event.repository.name }}
user_name: ${{ github.event.repository.owner.login }}
branch_base: "master"
python_version: '3.11'
is_pr: ${{ github.event.issue.pull_request != null }}
branch_name: ${{ github.event.pull_request.head.ref }}
permissions: write-all

jobs:
run-bot:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: run gptme-bot action
uses: ./.github/actions/bot
with:
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
issue_number: ${{ github.event.issue.number }}
comment_body: ${{ github.event.comment.body }}
comment_id: ${{ github.event.comment.id }}
repo_name: ${{ github.event.repository.name }}
user_name: ${{ github.event.repository.owner.login }}
branch_base: ${{ github.event.repository.default_branch }}
is_pr: ${{ github.event.issue.pull_request != null }}
branch_name: ${{ github.event.pull_request.head.ref || format('gptme/bot-changes-{0}', github.run_id) }}
allowlist: "erikbjare"
```
Please note that you need to replace the `uses` path with the correct path to your `bot-composite.yml` file. Also, make sure to replace the `branch_base`, `python_version`, `is_pr`, and `branch_name` inputs with the correct values for your use case.
The `gptme-bot` action will then run the `gptme` command-line tool with the command specified in the comment, and perform actions based on the output of the tool.

The `gptme-bot` composite action will then run the `gptme` command-line tool with the command specified in the comment, and perform actions based on the output of the tool. This includes checking out the appropriate branch, installing dependencies, running the `gptme` command, and committing and pushing any changes made by the tool. If the issue is a pull request, the action will push changes directly to the pull request branch. If the issue is not a pull request, the action will create a new pull request with the changes.
If a question was asked, it will simply reply.

If a request was made it will check out the appropriate branch, install dependencies, run `gptme`, then commit and push any changes made. If the issue is a pull request, the bot will push changes directly to the pull request branch. If the issue is not a pull request, the bot will create a new pull request with the changes.
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ See the `README <https://github.com/ErikBjare/gptme/blob/master/README.md>`_ fil
demos
tools
providers
webui
server
evals
bot
finetuning
cli
api
Expand Down
8 changes: 5 additions & 3 deletions docs/webui.rst → docs/server.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
Web UI
Server
======

.. note::
The web UI is still in development and does not have all the features of the CLI.
The server and web UI is still in development and does not have all the features of the CLI.
It does not support streaming, doesn't ask for confirmation before executing, lacks the ability to interrupt generations, etc.

gptme has a very minimalistic web UI, it can be started by running the following command:
gptme has a minimal REST API with very minimalistic web UI.

It can be started by running the following command:

.. code-block:: bash
Expand Down

0 comments on commit 18b7268

Please sign in to comment.