Gemini Integration Documentation
Overview
The Gemini Integration for the Vantage analytics and data platform provides methods for interacting with the Google Gemini API. This integration enables functionalities such as receiving chat completions and generating summaries for dashboard tiles using advanced AI capabilities.
The integration specifically utilizes Google's generative language models to provide insights, answers, and other informative outputs based on user inputs and provided data.
For more details on the API, refer to the official Gemini API Documentation.
Settings
The Gemini Integration contains several configurable settings that allow users to customize its behavior and functionality. Below is a detailed breakdown of each setting.
1. Model
- Setting Name:
model - Input Type: String
- Description: Specifies the AI model version to be used for API calls. The setting affects the underlying logic of the calls made to the Gemini API, allowing for behavior and output style to vary based on the chosen model.
- Default Value:
gemini-2.0-flash-exp
2. API Key
- Setting Name:
apiKey - Input Type: String
- Description: A required setting that holds the API key necessary for authenticating requests to the Gemini API. If this key is not provided, the integration will throw an error, and API calls will fail. Changing this value impacts access permissions and authentication to the Gemini API.
- Default Value: None (required to be configured)
3. Maximum Tokens
- Setting Name:
maxTokens - Input Type: Numeric
- Description: Defines the maximum number of tokens to be included in the AI's responses. Tokens are chunks of text, and limiting their number can help manage response length. Higher values allow for more detailed responses, while lower values may restrict content.
- Default Value:
500(in methods that include this setting)
4. Temperature
- Setting Name:
temperature - Input Type: Numeric
- Description: Controls the randomness of the AI's responses. A temperature of
0results in the most deterministic output, while higher values (up to a maximum of2) allow for more creative and varied responses. Changing this affects the diversity and creativity of the results generated by the model. - Default Value:
0.7(in methods that include this setting)
5. System Instruction
- Setting Name:
system - Input Type: String
- Description: An optional parameter that allows users to provide specific instructions or context to the AI. This can help the AI better understand the nature of the conversation or the parameters of the data being analyzed, thus directly influencing the outputs returned.
- Default Value: None (optional)
How It Works
The Gemini Integration is built on top of a base integration class, the base integration, which manages the connection to the Gemini API. Upon initialization, it captures settings like the API key and model selection.
The integration interacts with the Gemini API primarily through the following methods:
-
Chat Completion: This method allows users to send a series of messages to the AI and receive a generated response. Various parameters — including model choice, message contents, maximum tokens, and response temperature — influence the results.
-
Streaming Chat Completion: Similar to chat completion, but designed for more continuous exchanges, allowing partial responses to be processed in real-time.
-
Generate Tile Summary: This method summarizes data displayed in dashboard tiles, helping users gain insights quickly based on complex datasets. It builds context-sensitive prompts based on the provided data.
-
Chat with Context: Engages users in an interactive conversation regarding specific dashboard tiles, responding to follow-up questions and maintaining context throughout the interaction.
Each of these methods sends structured requests to the Gemini API and handles responses, converting them into formats compatible with user needs.
Expected Data
The integration expects specific types of data depending on the method being called:
-
For Chat Completions:
messages: An array of message objects containingrole(user or assistant) andcontent(the actual text).
-
For Tile Summary Generation:
tileTitle: Title of the tile.tileType: Type of data visualization.tileData: The actual data array or object from which the summary is generated.tileConfig: Any additional configuration for the tile.context: Optional additional context that may influence the summary.
-
For Streaming Chat Completion:
- The same parameters as chat completion, with a focus on real-time processing of ongoing conversations.
Use Cases & Examples
Use Case 1: Customer Support Automation
Using the Gemini Integration, a company can automate customer support responses by integrating the chat completion functionality into its service portal. This allows customers to receive instant responses to common inquiries, improving response times significantly.
Use Case 2: Business Intelligence Reports
A business analyst can use the Generate Tile Summary feature to prepare concise reports on dashboard visualizations. By summarizing complex data, stakeholders can quickly grasp insights without diving deeply into raw datasets.
Example Scenario: Automated Reporting
Suppose a retail company wishes to analyze sales data presented in a dashboard tile. The configuration for generating a summary might look like this:
{
"tileTitle": "Monthly Sales Overview",
"tileType": "line",
"tileData": {
"January": 10000,
"February": 15000,
"March": 18000
},
"tileConfig": {},
"context": "User wants a summary of the sales trends over the last three months.",
"userQuestion": ""
}With this configuration, the Gemini Integration processes the input and returns a structured summary with key insights and recommendations, such as:
- "Sales increased by 80% from January to March."
- "The peak sales month was March, with revenue of $18,000."
Billing Impacts
Utilizing the Gemini Integration may incur costs based on the number of API calls made, the number of tokens processed in requests and responses, and the specific model chosen. It's essential for users to monitor their usage to understand the financial implications of leveraging AI capabilities within their applications. Detailed billing information can typically be found in the platform's billing documentation or can be obtained by contacting customer support.
By leveraging the capabilities outlined in this documentation, users can effectively integrate and utilize the Gemini API within their environment, harnessing AI-powered insights to enhance decision-making and operational efficiency.