AIG. - AI Google Gemini Integration

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > AIG. - Google AI >

AIG. - AI Google Gemini Integration

1. Key Management

Previous Top Next


MiniRobotLanguage (MRL)

 

1. Key Management
Authentication & Security

 

Overview

 

Before the robot can "think" or "see," it must authenticate with Google's servers. The Key Management commands handle the API Key—a long string of characters obtained from Google AI Studio that acts as your robot's passport.

This section ensures your key is stored securely in memory and automatically attached to every request.

 

Visualizing the Authentication Flow

 

               [Google AI Studio] ───> (Generate Key) ───> "AIzaSy..."

                                                │

 ┌──────────────────────────────────────────────▼───┐

 │ ROBOT SCRIPT                                     │

 │ 1. AIG.Set Key|AIzaSy...                         │

 │ 2. AIG.Ask|... ───┐                              │

 └───────────────────┼──────────────────────────────┘

                     │ (Auto-Injects Key)

                     ▼

             [Google Cloud API]

 

Detailed Command List

 

AIG.Set Key - The first command you must run. It stores the API key in a secure global variable. Supports plain text keys or encrypted strings for distributed scripts.

AIG.Get Key - Retrieves the currently active key. Useful for debugging or verifying that a key was loaded correctly from an external file.

AIG.Save Key - Persists the key to a local configuration file or registry (depending on implementation), so the user doesn't need to enter it every time the robot runs.

 

Best Practices

 

1.Do not share scripts with your hardcoded API Key inside.

2.Use AIG.Set Key|$$VAR where $$VAR is loaded from an external, encrypted source or an environment variable.

3.If you receive "403 Forbidden" errors, verify your key in Google AI Studio.

 

See also:

 

How to get the API-Key

AIG.Set Key