...
After doing that, you need to configure it on each repository for which you want to use it.
Info |
---|
AI Review Assistant can be integrated with any AI Provider offering a
Examples of such providers are ChatGPT, Azure OpenAI, Google AI Gemini, Claude.ai or Ollama. |
Step 2: Configure the
...
AI Provider at the repository level
As a repository administrator, follow the following steps:
Get your API key from your AI provider.
For you get the API key OpenAI by going here.
Go to the Code Review Assistant settings page of your repository
Select the AI Provider: OpenAI or another AI Provider
For other AI providers, like Azure, provide the API URL for the chat completion API.
Contact our support for AI providers not yet supported.
Select a model supported by your API Key, and copy-paste your key in the input field.
Click on “Save”. You should see a confirmation flag that your data as been updated.
...
...
Follow the guide corresponding to your AI provider
Configuration guide for ChatGPT, Azure OpenAI, and Google AI Gemini
Configuration guide for Claude.ai
Configuration guide for Ollama
Configuration guide for a generic AI Provider.
Step 3 (Optional): Configure Custom Prompts
Custom prompts give you more flexibility to tailor AI Review Assistant to the needs of your repository. See the dedicated page to Custom Prompts configuration.
...
Usage - Suggest pull request title and description
On the create pull request page, you can use the AI Review Assistant to suggest a title and description
...
A spinner will show while waiting for the AI response. Once the suggestion is ready, text fields will appear for you to inspect and apply the suggestion.
...
Usage - Chat with AI Review Assistant through comments
You can interact with the AI Review Assistant directly in your pull request. To do so, write a comment in the view of your pull request starting by /aira
(short for AI Review Assistant) followed by your question for the AI. The AI service will receive the information related to your pull request (current title, description, commit titles, the diff and comments of the existing thread), followed by your question.
Once ChatGPT the AI provider has answered, AI Review Assistant will post a reply to your comment.
...
Some examples to get you started (see also below for more examples):
/aira What is the purpose of this change?
/aira Are there any password or PII information that leaked in this pull request?
/aira Can you write a description for this pull request?
...
It is possible to have the AI Review Assistant perform reviews of your pull requests automatically. To achieve that, you need to configure your pull request to create an automatic comment. This comment should begin with the standard /aira
prefix, followed by a question requesting a review. You can accomplish this in two ways: by utilizing Default tasks from Bitbucket, or using the Checklist Buddy plugin for Bitbucket.
Additionally, if you configure custom prompt templates (see examples), you can build a suite of finely-tuned automations.
Using Default tasks
In your repository settings, go to Default tasks
...
Click on Add a default task.
...
Fill in the Default task description with a prompt starting by
/aira
(and optionally the slug of a preconfigured custom prompt template).
See figure below for an example.
...
The AI Review Assistant will address all tasks and comments that begin with /aira
(and optionally the slug of a preconfigured custom prompt template). Below is an example of a PRCHECKLIST file:
...
Upon creation of a pull request to the main
branch, these comments will be created, and AI Review Assistant will respond like in the image below.
...
Example prompts
Read more in our guide Example Prompts by Use Case which talks through how to create specialist prompts for the AI Review Assistant that help with common pull request review tasks.
...
FAQ
How can I disable AI Review Assistant for my Bitbucket Instance?
...
How can I disable AI Review Assistant for a repository?
There is no toggle to disable AI Review Assistant Disable AIRA for a repository. However, if you do not configure the assistant (by not filling the token information), then it will be effectively disabled, and no data will be shared to the AI API.If you previously configured AI Review Assistant, you can remove the token by saving the configuration with an empty tokenspecific repository by going to the Code Review Assistant settings page in your repository, and set the Enable Assistant toggle to disabled.
You can’t enable AIRA for a repository if it is disabled globally.
Who can use AI Review Assistant on a pull request?
...
First, try to refresh the page. AI Review Assistant responds to Pull Request comments, and those are not refreshed automatically. If the response is still not there, please check the following things.
Verify that AIRA reacted to your comment with a 👀 emoji. If the emoji is not there, then something is wrong and you should contact an Administrator.
Sometimes the AI Review Assistant can take a bit of time to answer (up to 2 minutes). Past that time, you should see a message saying that it took too much time.
AI Review Assistant will also respond in case there is another issue with your request (for example, API Key is not properly configured). If, however, nothing happens after 2 minutes, this indicates that there is an unknown issue, and you should contact an Administrator.
Can I make the AI only look at a smaller part of the Pull Request?
By default, when writing a comment to the AI Review Assistant (or responding to a comment where it is involved), AI Review Assistant receives the exhaustive diff of the Pull Request.
It is however possible to narrow down the scope on demand. This helps avoiding errors about context too large for larger pull requests.
To do that, respond to an AI comment by a comment starting with Context:
, then the list of files (with complete path from the repository root), with one file per line. Such a comment would look like the following:
Code Block |
---|
Context:
path/to/file1.txt
path/to/file2.py |
You can see an example in action below:
...