From 5312fafa4f2c7007c12b85a055209a219aebdcc1 Mon Sep 17 00:00:00 2001 From: John Kuhn Date: Thu, 6 Jul 2023 19:14:31 -0700 Subject: [PATCH] Drop idea of a root language (#26) --- .github/workflows/robin.yml | 2 +- README.md | 1 - action.yml | 5 ----- src/gpt.sh | 8 +++----- src/main.sh | 4 ++-- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/robin.yml b/.github/workflows/robin.yml index 830f5ef..2db8406 100644 --- a/.github/workflows/robin.yml +++ b/.github/workflows/robin.yml @@ -12,7 +12,7 @@ jobs: with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} OPEN_AI_API_KEY: ${{ secrets.OPEN_AI_API_KEY }} - root_language: "bash" + gpt_model_name: "gpt-4" files_to_ignore: | "README.md" "assets/*" diff --git a/README.md b/README.md index 983d844..2cc2930 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,6 @@ With those steps complete, Robin AI will automatically run every time a pull req | `OPEN_AI_API_KEY` | Yes | N/A | An API key from Open AI's [developer portal](https://platform.openai.com/account/api-keys). | | `gpt_model_name` | No | `gpt-3.5-turbo` | The name of the GPT model to use for text generation. | | `github_api_url` | No | `https://api.github.com` | The URL for the Github API endpoint. (Only relevant to enterprise customers.) | -| `root_language` | No | to infer | The primary coding language of the project. | | `coding_principles` | No | readability, maintainability, single responsibility principle, DRY principle | The main coding principles to uphold. | | `ignored_principles`| No | code comments, heredoc comments, unused imports | The coding principles to ignore. | | `files_to_ignore` | No | (empty string) | A whitespace delimited list of files to ignore. | diff --git a/action.yml b/action.yml index 927779c..15fe63f 100644 --- a/action.yml +++ b/action.yml @@ -15,10 +15,6 @@ inputs: description: 'URL to the API of your Github Server, only necessary for Github Enterprise customers' required: false default: 'https://api.github.com' - root_language: - description: 'The primary language of the repository' - required: false - default: 'to infer' coding_principles: description: 'The main points of feedback and code principles to maintain' required: false @@ -39,7 +35,6 @@ runs: - --open_ai_api_key=${{ inputs.OPEN_AI_API_KEY }} - --gpt_model_name=${{ inputs.gpt_model_name }} - --github_api_url=${{ inputs.github_api_url }} - - --root_language=${{ inputs.root_language }} - --coding_principles=${{ inputs.coding_principles }} - --ignored_principles=${{ inputs.ignored_principles }} - --files_to_ignore=${{ inputs.files_to_ignore }} diff --git a/src/gpt.sh b/src/gpt.sh index b07337a..b2297b3 100755 --- a/src/gpt.sh +++ b/src/gpt.sh @@ -3,12 +3,10 @@ gpt::prompt_model() { local -r git_diff="$1" local -r initial_prompt=$(cat < --open_ai_api_key= --gpt_model_name= --github_api_url= --root_language= --coding_principles= --ignored_principles= --files_to_ignore= +##? main.sh --github_token= --open_ai_api_key= --gpt_model_name= --github_api_url= --coding_principles= --ignored_principles= --files_to_ignore= main() { eval "$(/root/bin/docpars -h "$(grep "^##?" "$HOME_DIR/src/main.sh" | cut -c 5-)" : "$@")" @@ -26,7 +26,7 @@ main() { exit fi - local -r gpt_response=$(gpt::prompt_model "$commit_diff" "$root_language" "$coding_principles" "$ignored_principles" ) + local -r gpt_response=$(gpt::prompt_model "$commit_diff" "$coding_principles" "$ignored_principles" ) if [ -z "$gpt_response" ]; then echoerr "GPT's response was NULL. Double check your API key and billing details."