Google Gemini
Updated
Integrate a Google Gemini LLM into Conversational AI Engine.
Google Gemini provides advanced multimodal AI capabilities with fast performance and efficient processing for conversational AI applications.
Sample configuration
The following example shows how to configure Google Gemini LLM when starting a conversational AI agent.
from agora_agent import Agent, Gemini
# client is your configured Agora client
agent = (
Agent(client)
.with_stt(...) # configure your STT vendor
.with_llm(Gemini(
api_key='your-google-api-key',
model='gemini-3.6-flash',
system_messages=[{'parts': [{'text': 'You are a helpful chatbot.'}], 'role': 'user'}],
greeting_message='Good to see you!',
failure_message='Hold on a second.',
max_history=32,
))
.with_tts(...) # configure your TTS vendor
)import { Agent, Gemini } from 'agora-agents';
// client is your configured Agora client
const agent = new Agent({ client })
.withStt(/* configure your STT vendor */)
.withLlm(new Gemini({
apiKey: 'your-google-api-key',
model: 'gemini-3.6-flash',
systemMessages: [{ parts: [{ text: 'You are a helpful chatbot.' }], role: 'user' }],
greetingMessage: 'Good to see you!',
failureMessage: 'Hold on a second.',
maxHistory: 32,
}))
.withTts(/* configure your TTS vendor */);import (
Agora "github.com/AgoraIO/agora-agents-go/v2"
"github.com/AgoraIO/agora-agents-go/v2/agentkit"
"github.com/AgoraIO/agora-agents-go/v2/agentkit/vendors"
)
// client is your configured Agora client
agent := agentkit.NewAgent(client).WithStt(/* configure your STT vendor */).
WithLlm(
vendors.NewGemini(vendors.GeminiOptions{
APIKey: "your-google-api-key",
Model: "gemini-3.6-flash",
SystemMessages: []map[string]interface{}{
{"parts": []map[string]interface{}{{"text": "You are a helpful chatbot."}}, "role": "user"},
},
GreetingMessage: "Good to see you!",
FailureMessage: "Hold on a second.",
MaxHistory: Agora.Int(32),
}),
).WithTts(/* configure your TTS vendor */)Use the following llm configuration in your request:
"llm": {
"url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.6-flash:streamGenerateContent?alt=sse&key=<api_key>",
"system_messages": [
{
"parts": [
{
"text": "You are a helpful chatbot"
}
],
"role": "user"
}
],
"max_history": 32,
"greeting_message": "Good to see you!",
"failure_message": "Hold on a second.",
"params": {
"model": "gemini-3.6-flash"
},
"style": "gemini"
}Key parameters
| Parameter | Description |
|---|---|
urlstring | Note that the API key is passed in the URL query parameter. Get your API key from Google AI Studio. |
system_messagesarray[object] | Use |
stylestring | Set to |
ignore_emptyboolean | Set to |
paramsobject |
|
For advanced configuration options, model capabilities, and detailed parameter descriptions, see the Google Gemini API documentation.
