-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(azureai): Add support for azure open Ai (#377)
* feat(azureai): add azure AI to supported models. * feat(azureai): add in test PR review process. * add in break * feat(azureai): add demo workflow. * feat(azureai): add check for either open ai, or azure open ai key. * docs(azureai): add documentation for Azure Open Ai * chore: delete test workflow.
- Loading branch information
Showing
4 changed files
with
52 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Provider Configuration | ||
|
||
## Using the Azure OpenAI Provider | ||
|
||
This section will guide you through configuring and using the Azure OpenAI provider in your Code Review project, which leverages Large Language Models (LLMs) to enhance your code quality and prevent bugs before they reach production. | ||
|
||
### Prerequisites | ||
|
||
Before you begin, make sure you have the following: | ||
|
||
- Azure OpenAI service with a model that supports [Structured Outputs](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/structured-outputs) | ||
- Necessary secrets stored in your repository/environment settings. | ||
|
||
To set up the code review script with the Azure OpenAI provider on GitHub CI, add the following configuration in your GitHub Actions workflow file (e.g., .github/workflows/review.yml): | ||
|
||
```yaml | ||
- name: Run code review script | ||
run: bun run start review --ci=github --provider=azureai | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BASE_SHA: ${{ github.event.pull_request.base.sha }} | ||
GITHUB_SHA: ${{ github.sha }} | ||
AZURE_OPENAI_API_INSTANCE_NAME: "my-azure-open-ai-instance" | ||
AZURE_OPENAI_API_DEPLOYMENT_NAME: "gpt-40" | ||
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} | ||
AZURE_OPENAI_API_VERSION: "2024-08-01-preview" | ||
``` | ||
Key Environment Variables | ||
AZURE_OPENAI_API_INSTANCE_NAME: The unique name of your Azure OpenAI instance. | ||
AZURE_OPENAI_API_DEPLOYMENT_NAME: The deployment name of the model instance you are utilizing in Azure. | ||
AZURE_OPENAI_API_KEY: Your Azure OpenAI API key; should be stored securely as a secret. | ||
AZURE_OPENAI_API_VERSION: Specifies the API version you're using, supporting future and preview versions. | ||
### Troubleshooting | ||
- Invalid API Keys: Double-check your secrets to ensure that they are accurate and up-to-date. | ||
- Deployment Issues: Verify that the deployment names and instance names are correctly stated and match those in your Azure set up. | ||
- `400 Invalid parameter: 'response_format' of type 'json_schema' is not supported with this model` ensure that you're using a model that supports [Structured Outputs](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/structured-outputs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters