Overview
GoogleLLMService
provides integration with Google’s Gemini models, supporting streaming responses, function calling, and multimodal inputs. It includes specialized context handling for Google’s message format while maintaining compatibility with OpenAI-style contexts.
API Reference
Complete API documentation and method details
Gemini Docs
Official Google Gemini API documentation and features
Example Code
Working example with function calling
Installation
To useGoogleLLMService
, install the required dependencies:
GOOGLE_API_KEY
.
Get your API key from Google AI
Studio.
Frames
Input
OpenAILLMContextFrame
- Conversation context and historyLLMMessagesFrame
- Direct message listVisionImageRawFrame
- Images for vision processingLLMUpdateSettingsFrame
- Runtime parameter updates
Output
LLMFullResponseStartFrame
/LLMFullResponseEndFrame
- Response boundariesLLMTextFrame
- Streamed completion chunksLLMSearchResponseFrame
- Search grounding results with citationsFunctionCallInProgressFrame
/FunctionCallResultFrame
- Function call lifecycleErrorFrame
- API or processing errors
Search Grounding
Google Gemini’s search grounding feature enables real-time web search integration, allowing the model to access current information and provide citations. This is particularly valuable for applications requiring up-to-date information.Enabling Search Grounding
Handling Search Results
Search grounding producesLLMSearchResponseFrame
with detailed citation information:
Function Calling
Function Calling Guide
Learn how to implement function calling with standardized schemas, register
handlers, manage context properly, and control execution flow in your
conversational AI applications.
Context Management
Context Management Guide
Learn how to manage conversation context, handle message history, and
integrate context aggregators for consistent conversational experiences.
Usage Example
Metrics
Google Gemini provides comprehensive usage tracking:- Time to First Byte (TTFB) - Response latency measurement
- Processing Duration - Total request processing time
- Token Usage - Prompt tokens, completion tokens, and totals
Learn how to enable Metrics in your Pipeline.
Additional Notes
- Multimodal Capabilities: Native support for text, images, audio, and video processing
- Search Grounding: Real-time web search with automatic citation and source attribution
- System Instructions: Handle system messages differently than OpenAI - set during initialization
- Vision Functions: Built-in support for image capture and analysis from video streams