|
<< 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 |
MiniRobotLanguage (MRL)
AIG.SetBaseUrl
Set the Base URL for Google Gemini API Endpoints
Intention
Configure the base part of the URL used for constructing the full API endpoint. This allows switching between different API versions, such as the stable `v1` endpoint and the `v1beta` endpoint, which might contain experimental models or features.
This Command sets the AIG_CurrentBaseEndpoint global variable. The value of this variable is used by AIG.Get Endpoint as the first part when dynamically constructing the full API URL.
The typical base URLs are:
�https://generativelanguage.googleapis.com/v1/models (Default, Stable)
�https://generativelanguage.googleapis.com/v1beta/models (Beta/Experimental)
Providing an empty string ("") resets the base URL to the default v1 endpoint defined by $AIG_BaseEndpoint.
Use this Command primarily to:
�Access Beta/Experimental Models: Target models or features available only on the `v1beta` endpoint.
�Ensure Default Endpoint: Reset to the stable `v1` endpoint after using a different one.
Provide the desired base URL string as parameter P1. Omit the parameter or provide an empty string to reset to the default `v1` base URL.
Example Usage
' Use exp.-Models from the v1beta Endpoint
AIG.Set Key|File
'Waiting Time: 6 sec (10 rpm/ 1500 free/day)
$$MOD=gemini-2.5-pro-exp-03-25
'$$MOD=gemini-1.5-flash
' 1. Set the Base URL to the BETA endpoint
AIG.SetBaseUrl|https://generativelanguage.googleapis.com/v1beta/models
AIG.Set Model|$$MOD
AIG.Set MaxToken|130000
GSB.Get_Prompt
AIG.Ask|$$PRO|$$RET
MBX.$$RET
ENR.
// Switch to the v1beta endpoint
AIG.SetBaseUrl|https://generativelanguage.googleapis.com/v1beta/models
DBP. Base URL set to v1beta.
// Subsequent AIG.GetEndpoint calls will use the v1beta base
// ... make calls using beta models ...
// Reset back to the default v1 endpoint
AIG.SetBaseUrl|""
DBP. Base URL reset to default v1.
Syntax
AIG.SetBaseUrl|P1
AIG.sbu|P1
Parameter Explanation
P1 - (Optional) The base URL string (e.g., `https://generativelanguage.googleapis.com/v1beta/models`).
� �- If a non-empty URL is provided, it sets the base URL for subsequent endpoint constructions.
� �- If an empty string (`""`) is provided or the parameter is omitted, the base URL resets to the default v1 endpoint (`$AIG_BaseEndpoint`).
Example
// Set base URL to v1beta
AIG.sbu|https://generativelanguage.googleapis.com/v1beta/models
ENR.
Remarks
- The provided URL should typically end with `/models`.
- Use AIG.getbaseurl to verify the currently set base URL.
Limitations
- No validation is performed on the provided URL format or accessibility.
- Setting an incorrect base URL will cause subsequent API calls to fail.
- This only changes the URL; it does not change the authentication method. If the target endpoint requires OAuth 2.0, calls may still fail if only an API key is configured.
See also:
? Endpoint Management (Conceptual Overview)