From d89e567379703f7f466ce64b277a00592e9b075c Mon Sep 17 00:00:00 2001 From: Sylvie Date: Tue, 15 Oct 2024 16:46:52 -0500 Subject: [PATCH] OpenAI PR Agent Setup (#1429) --------- Co-authored-by: Bella Luz Quintero Co-authored-by: saquino0827 Co-authored-by: James Herr Co-authored-by: halprin --- .github/workflows/pr_agent.yml | 32 ++++++++++++++++++++++++++++++++ .pr_agent.toml | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 .github/workflows/pr_agent.yml diff --git a/.github/workflows/pr_agent.yml b/.github/workflows/pr_agent.yml new file mode 100644 index 000000000..aa14bb692 --- /dev/null +++ b/.github/workflows/pr_agent.yml @@ -0,0 +1,32 @@ +name: Perry the PR Agent Platypus + +# Config for this action lives in .pr_agent.toml, but only the version on +# main is read - you'll need to merge config changes before they take effect. +# You can test config changes by making them in the `env` section below, but +# should then move them to the config file for consistency/readability + +on: + pull_request: + issue_comment: + types: [created] +jobs: + pr_agent_job: + if: ${{ github.event.sender.type != 'Bot' }} + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + contents: write + name: Run pr agent on every pull request, respond to user comments + steps: + - name: PR Agent action step + id: pragent + uses: Codium-ai/pr-agent@main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OPENAI_KEY: ${{ secrets.AZURE_OPENAI_KEY }} + OPENAI.API_TYPE: 'azure' + OPENAI.API_BASE: ${{ secrets.AZURE_OPENAI_BASE_URL }} + OPENAI.DEPLOYMENT_ID: ${{ secrets.AZURE_OPENAI_DEPLOYMENT_ID }} + OPENAI_API_VERSION: '2023-03-15' + AZURE_API_VERSION: '2023-03-15-preview' # Specific version required to address compatibility issues with GPT-4 deployment on Azure. diff --git a/.pr_agent.toml b/.pr_agent.toml index 7f76243e9..e760b5bcd 100644 --- a/.pr_agent.toml +++ b/.pr_agent.toml @@ -1,4 +1,6 @@ # See https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml for all possible config options +# The pr_agent.yml action reads this file from the `main` branch, so changes to this file +# will not take effect until they are merged into main [config] model="gpt-4" # the OpenAI model you've deployed on Azure (e.g. gpt-3.5-turbo)