Google Gemini
Google Gemini is an AI platform that provides intelligent, context-aware responses to user queries.
Google Gemini is a powerful AI-driven platform designed for advanced text generation and natural language processing. The Google Gemini Connector allows Swimlane Turbine users to seamlessly integrate AI-generated responses into their security workflows. By leveraging this integration, users can enhance their playbooks with dynamic, AI-driven insights, improving decision-making and response times in security operations. This connector empowers users to automate complex text generation tasks, providing a significant boost to the efficiency and effectiveness of security processes.
Prerequisites
Before you can use the Google Gemini connector for Turbine, you'll need access to the Google Gemini API. This requires the following:
- an API key authentication using the following parameters:
- API Key: A unique key provided by Google to authenticate requests.
- Model: The specific AI model to be used for generating responses.
Getting an API Key
- Go to Google AI Studio
- Navigate to the API Keys page from the Dashboard
- Click Create API Key and select your project
- Copy the generated API key for use in the connector
Capabilities
This Connector provides the following capabilities:
- Text Generation: Generate human-like text responses to prompts
- Question Answering: Ask questions and receive comprehensive answers
- Content Analysis: Analyze and summarize text content
- Creative Writing: Generate creative content, stories, and explanations
- Code Generation: Generate and explain code snippets
- Multi-model Support: Access to multiple Gemini model variants with different capabilities
Limitations
- Rate Limits: Subject to Google's API rate limits and quotas
- Model Availability: Some models may have regional availability restrictions
- Parameter Support: Not all models support all generation parameters (e.g., top_k)
- Token Limits: Responses are limited by the max_tokens parameter (default: 1024, max: 8192)
- Content Safety: All responses are subject to Google's safety filters
Asset Setup
Required Configuration
- Base URL: https://generativelanguage.googleapis.com (default)
- API Key: Your Google Gemini API key from Google AI Studio
- Model: Select from supported Gemini models:
- gemini-2.5-pro - Most capable model for complex tasks
- gemini-2.5-flash - Fast and efficient for most use cases
- gemini-2.5-flash-lite - Lightweight version with reduced capabilities
- gemini-2.0-flash - Previous generation fast model
- gemini-2.0-flash-lite - Previous generation lightweight model
Optional Configuration
- Max Tokens: Maximum response length (1-8192, default: 1024)
- Temperature: Response creativity (0.0-1.0, default: 0.7)
- Top P: Nucleus sampling (0.0-1.0, default: 0.95)
- Top K: Top-k sampling (1-100, default: 64, not supported by all models)
- Thinking Budget: Thinking budget for Gemini 2.5 models (0-1000, default: 0, 0 disables thinking)
Model Parameter Support
Model | Max Tokens | Temperature | Top P | Top K | Thinking |
|---|---|---|---|---|---|
Gemini 2.5 Pro | β | β | β | β | β |
Gemini 2.5 Flash | β | β | β | β | β |
Gemini 2.5 Flash-Lite | β | β | β | β | β |
Gemini 2.0 Flash | β | β | β | β | β |
Gemini 2.0 Flash-Lite | β | β | β | β | β |
Tasks Setup
Ask Gemini Action
The connector provides a single action called "Ask Gemini" that accepts:
Input:
- prompt (string, required): The question or prompt to send to Gemini
Output:
- response (string): The AI-generated response
- model_used (string): The model that generated the response
- tokens_used (integer): Number of tokens consumed
- finish_reason (string): Reason for generation completion
- safety_ratings (array): Content safety assessments
Example Usage
## Example playbook action
action: ask_gemini
parameters:
prompt: "Explain the concept of machine learning in simple terms"Notes
- API Key Security: Keep your API key secure and never expose it in client-side code
- Cost Management: Monitor your usage through Google AI Studio to manage costs
- Error Handling: The connector includes comprehensive error handling for common API issues
- Model Selection: Choose the appropriate model based on your needs - Pro for complex tasks, Flash for speed
- Parameter Tuning: Experiment with temperature and other parameters to achieve desired response characteristics
Reference URLs
Additional Documentation
Configurations
Google Gemini AI Configuration
Configuration for Google Gemini AI API with model selection and generation parameters
Configuration Parameters
Parameter | Description | Type | Required |
|---|---|---|---|
apiKey | API key for Google Gemini authentication | string | Required |
model | Gemini model to use for text generation | string | Required |
max_tokens | Maximum number of tokens in the response (default- 1024) | integer | Optional |
temperature | Controls randomness in responses (0.0-2.0) (default- 0.7) | number | Optional |
top_p | Nucleus sampling parameter (0.0-1.0) (default- 0.95) | number | Optional |
top_k | Top-k sampling parameter (default- 64) - Not supported by Flash-Lite models | number | Optional |
Actions
Ask Gemini
Send a prompt to Google Gemini and receive an AI-generated response. This action requires a specific prompt parameter.
Endpoint
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
prompt | string | Required | The prompt or question to send to Gemini |
Input Example
{"prompt":"string"}
Output
Parameter | Type | Description |
|---|---|---|
response | string | The AI-generated response from Gemini |
model_used | string | The model that was used to generate the response |
tokens_used | integer | Number of tokens used in the response |
finish_reason | string | Reason why the generation finished |
Output Example
{"response":"string","model_used":"string","tokens_used":123,"finish_reason":"string"}
Response Headers
Header | Description | Example |
|---|---|---|
Content-Type | The media type of the resource | application/json |
Date | The date and time at which the message was originated | Thu, 01 Jan 2024 00:00:00 GMT |