Bard is a conversational generative artificial intelligence chatbot developed by Google, based on the PaLM 2 Large Language Model.
The setup process for Bard is a bit more complicated than for ChatGPT, since Bard is not a standalone service, but a part of Google Cloud, which needs to be configured as well. This is a one-time process that takes a few minutes.
Vertex AI is a platform that offers all AI services of Google Сloud under one roof. Among other things, it provides access to Bard.
In the context of AI Toolbox we use “Bard” to refer both to the chatbot and the Vertex AI service.
Setting up Bard in AI Toolbox consists of the following steps:
- Set up a Google Cloud project.
- Configure access to Bard from Unity.
Let’s go through these steps in detail.
Set up a Google Cloud project
First, you need to create a Google Cloud project and enable Vertex AI API. This is a one-time process that takes a few minutes. After that, you can use Bard in any AI Toolbox project. If you already have a Google Cloud project, skip the first three steps.
- Go to Google Cloud and click Get started for free or Start free.
- Follow the instructions to specify a Google account and set up a billing account. You will need to provide a payment method, but you will not be charged anything unless you explicitly upgrade to a paid plan. You can find more information about the free plan here.
- Go to the Google Cloud Console and click on My First Project, which has been automatically created for you.
- Copy the Project ID from the Project info section. In Unity, open Project Settings > AI Toolbox and paste the ID into the Project ID field in the Google Bard section.
- Enable Vertex AI API:
- Go to the APIs & Services page.
- Click Enable APIs and Services.
- Search for Vertex AI API, select it, and click Enable.
Configure access to Bard
Now you need to set up access to the project from your Unity Editor.
- Install the Google Cloud SDK on your development machine. Follow the instructions for your operating system.
- Provide the SDK installation path in Unity
- If you are using MacOS, open Project Settings > AI Toolbox and paste the Google Cloud SDK path into the SDK Path field in the Google Bard section. If you are not sure what the path is, simply click Find SDK Path on the settings page.
- If you are using Windows, skip this step.
- In Unity, open Project Settings > AI Toolbox and click Login Google Cloud SDK. This will open a browser window where you need to log into your Google account and grant access to the Google Cloud SDK.
- On the same Settings page, click Login Google Auth Library. This will open a browser window where you need to log into your Google account and grant access to the Google Auth Library, which is used to authenticate to the Google Cloud APIs.
- Click Get Access Token. This will automatically fill in the Access Token field.
- Access tokens expire after 1 hour, at which point you will need to click Get Access Token again. You can also click Get Access Token to get a new token before the current one expires.
- Lastly, click Test connection. If everything is set up correctly, you will see a message with a greeting from Bard.
Done! You can now use Bard in your Unity project to generate scripts, explain code, chat with your AI assistant, etc.
AI Toolbox does not access or store your Google Cloud credentials or any other information about your Google account. The only information that is stored (in encrypted form) is the access token, which is used to authenticate to the Google Cloud APIs.