Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarifications on Azure Open AI configuration #879

Open
krishnakalyan3 opened this issue Apr 22, 2024 · 5 comments
Open

Clarifications on Azure Open AI configuration #879

krishnakalyan3 opened this issue Apr 22, 2024 · 5 comments

Comments

@krishnakalyan3
Copy link

I am unable to get the PR agent to work. Can you please let me know if I have configured the action correctly.

on:
  pull_request:
    types: [opened, reopened, ready_for_review]
  issue_comment:
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:
          OPENAI.API_TYPE: "azure"
          OPENAI.DEPLOYMENT_ID: "gpt4" 
          OPENAI_KEY: xxx
          OPENAI.API_BASE: xxx
          OPENAI.API_VERSION: "2024-02-15-preview"
          OPENAI.GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Related: #245

@krishnakalyan3
Copy link
Author

cc: @okotek

@gregmeldrum
Copy link

As a workaround, I added the following to my .pr_agent.toml and it worked:

[openai]
api_type = "azure"
api_version = '2024-02-01'
api_base = ...
deployment_id = "gpt-4"

@blakeashleyjr
Copy link

@gregmeldrum Do you mind providing more details about your config? I can't get mine working with Azure AI. Did you change the action before it started working?

@gregmeldrum
Copy link

@blakeashleyjr I realize that one of the key things I did (happy accident) was to name my azure model deployments the same as what you would expect for openai model names (for instance "gpt-4" and "gpt-4o"). I set the OPENAI_KEY to be my Azure OpenAI key. The main part of the work-around however was what I mentioned above about adding an [openai] section in my .pr_agent.toml in the root directory of the repo with the appropriate azure settings.

[openai]
api_type = "azure"
api_version = '2024-02-01'
api_base = ....
deployment_id = "gpt-4"

[config]
model="gpt-4o"
model_turbo="gpt-4"

@Jyny
Copy link

Jyny commented Jun 7, 2024

@krishnakalyan3
this works for me:

env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    github_action_config.auto_review: "true"
    github_action_config.auto_describe: "true"
    github_action_config.auto_improve: "true"
    OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
    OPENAI.API_TYPE: 'azure'
    OPENAI.API_BASE: 'https://YOUR_RESOURCE.openai.azure.com'
    OPENAI.DEPLOYMENT_ID: 'YOUR_DEPLOYMENT'
    OPENAI.API_VERSION: '2024-02-01'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@gregmeldrum @Jyny @krishnakalyan3 @blakeashleyjr and others