AIG. - AI Google Gemini Integration

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > AIG. - Google AI > 2. Configuration (Connection & Endpoint) >

AIG. - AI Google Gemini Integration

AIG.GetBaseUrl

Previous Top Next


MiniRobotLanguage (MRL)

 

AIG.GetBaseUrl
Retrieve the Current API Base Endpoint

 

Intention

 

Retrieves the currently configured Base URL for the Google Gemini API. This string defines the version of the API being used (e.g., Stable vs. Preview) and the root server address.

 

What is the GetBaseUrl Command?

 

This command returns the content of the AIG_CurrentBaseEndpoint global variable. This variable is crucial because it determines which generation of features is accessible to the robot.

 

Valid Google API Endpoints

 

The returned URL will typically match one of the following official Google endpoints:

https://generativelanguage.googleapis.com/v1/models
(Stable) This is the default. It supports production-ready models like gemini-1.5-flash and gemini-1.5-pro. Use this for maximum reliability.

https://generativelanguage.googleapis.com/v1beta/models
(Preview) Required for experimental features like Gemini 2.0, Imagen 3 (Image Generation), and "Thinking" mode. This endpoint is often free-to-use for new models.

 

Why Do You Need It?

 

Debugging: If features like Image Generation fail, verify that the URL contains "v1beta".

Configuration Check: Confirm that AIG.SetApiVersion correctly updated the system.

 

How to Use

 

Call the Command, optionally providing a variable name (P1) to store the resulting base URL string.

 

Example Usage

 

// 1. Check Default (Stable)

AIG.GetBaseUrl|$$URL

DBP.Current Endpoint: $$URL

' Output: .../v1/models

 

// 2. Switch to Preview for advanced features

AIG.SetApiVersion|v1beta

 

// 3. Verify

AIG.GetBaseUrl|$$URL

DBP.New Endpoint: $$URL

' Output: .../v1beta/models

 

Syntax

 

AIG.GetBaseUrl[|P1]

AIG.gbu[|P1]

 

Parameter Explanation

 

P1 - (Optional) The name of the variable (e.g., `$$MyV`) where the retrieved base URL string should be stored.

 

See also:

 

? AIG.SetApiVersion

? AIG.SetBaseUrl

? AIG.GetEndpoint