Gemini (aka Bard) is a conversational generative artificial intelligence chatbot developed by Google, based on the state-of-the-art language models. AI Toolbox integrates with Gemini to provide a seamless experience for generating code, explaining code, and chatting with your AI assistant.

As of AI Toolbox ver 5.1.0 we have greatly simplified the setup process for Gemini. Now the setup generally takes just a few minutes and does not require any special knowledge or skills.

Setting up Gemini in AI Toolbox consists of the following steps:

  1. Set up a Google Cloud project using Google AI Studio,
  2. Configure access to Gemini 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 get an API key. This is a one-time process that takes a few minutes. After that, you can use Gemini in any AI Toolbox project.

To do this, log into Google AI Studio and create and API key on the following page:

Google AI Studio “Get API key” page

If you don’t have a Google account, you will need to create one. You can use your existing email address or create a new one.

You can either create a new project or use an existing one. In either case, Google AI Studio will automatically configure the project for you.

Google AI Studio “Create API key” menu

Once you have created the API key, save it to use in the next step.

Configure access to Gemini from Unity

Now you need to set up access to the project from your Unity Editor.

  1. In Unity, go to Edit > Project Settings.
  2. Select AI Toolbox from the list on the left.
  3. Under Google Gemini tab, paste the API key you obtained in the previous step into the API Key field.

Gemini settings in AI Toolbox

Done! You can now use Gemini in your Unity project to generate scripts, explain code, chat with your AI assistant, etc. To do this, simply select Google Gemini in the Chatbot dropdown in the code generation window or the chat window.