Bundle
Google Gemini API client. Supports text generation, multimodal inputs (image, audio, video), chat sessions, function calling, and caching. Set GOOGLE_API_KEY before use. Compile with -lib gemini.
EndPoint
Gemini endpoint
Operations
GetApiKey # function
Reads API from 'api_key.dat'
function : GetApiKey() ~ StringReturn
| Type | Description |
|---|---|
| String | API key |
GetLastError # function
Get the last error
function : GetLastError() ~ StringReturn
| Type | Description |
|---|---|
| String | last error |
ParseBody # function
Parses a response body, recording a failure as the last error (the error was only printed before, so GetLastError() never reported it). A body that is not JSON, or that carries an 'error' object, yields Nil.
function : ParseBody(body:String) ~ JsonElementParameters
| Name | Type | Description |
|---|---|---|
| body | String | response body |
Return
| Type | Description |
|---|---|
| JsonElement | parsed JSON, or Nil on failure |