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.
OAuthEndPoint
OAuth enabled endpoint class
Operations
GetLastError # function
Get the last error
function : GetLastError() ~ StringReturn
| Type | Description |
|---|---|
| String | last error |
GetToken # function
Get OAuth token
function : GetToken() ~ StringReturn
| Type | Description |
|---|---|
| String | OAuth token |
ParseErrorMessage # function
Reads the message of an error response. The parser keeps a JSON string's escapes, so the message is JSON-unescaped here; an error without a message gives the error element's JSON text.
function : ParseErrorMessage(response_json:JsonElement) ~ StringParameters
| Name | Type | Description |
|---|---|---|
| response_json | JsonElement | parsed response |
Return
| Type | Description |
|---|---|
| String | error message, or Nil if the response holds no error |
ResponseText # function
Reads a response body as text. A reply with no body (an HTTP 204, a proxy error page without content) has no content bytes to read.
function : ResponseText(response:Web.HTTP.Response) ~ StringParameters
| Name | Type | Description |
|---|---|---|
| response | Response | HTTP response, or Nil |
Return
| Type | Description |
|---|---|
| String | body text, or an empty string if the response has no body |