Google Gemini adapter for PULSE Protocol — talk to Gemini with semantic messages.
Same interface as pulse-openai and pulse-anthropic — swap provider in one line. Zero Gemini boilerplate. Uses the new google-genai SDK (recommended by Google).
pip install pulse-geminifrom pulse import PulseMessage
from pulse_gemini import GeminiAdapter
adapter = GeminiAdapter(api_key="AIza...")
# Ask a question
msg = PulseMessage(
action="ACT.QUERY.DATA",
parameters={"query": "What is quantum computing?"}
)
response = adapter.send(msg)
print(response.content["parameters"]["result"])# from pulse_gemini import GeminiAdapter as Adapter
# from pulse_anthropic import AnthropicAdapter as Adapter
from pulse_openai import OpenAIAdapter as Adapter
adapter = Adapter(api_key="...")Your code stays exactly the same. Only the import changes.
| PULSE Action | What It Does | Default Model |
|---|---|---|
ACT.QUERY.DATA |
Ask a question | gemini-2.0-flash |
ACT.CREATE.TEXT |
Generate text | gemini-2.0-flash |
ACT.ANALYZE.SENTIMENT |
Analyze sentiment | gemini-2.0-flash |
ACT.ANALYZE.PATTERN |
Find patterns | gemini-2.0-flash |
ACT.TRANSFORM.TRANSLATE |
Translate text | gemini-2.0-flash |
ACT.TRANSFORM.SUMMARIZE |
Summarize text | gemini-2.0-flash |
msg = PulseMessage(
action="ACT.ANALYZE.SENTIMENT",
parameters={"text": "This is the best day ever!"}
)
response = adapter.send(msg)msg = PulseMessage(
action="ACT.TRANSFORM.TRANSLATE",
parameters={"text": "Hello, world!", "target_language": "German"}
)
response = adapter.send(msg)msg = PulseMessage(
action="ACT.TRANSFORM.SUMMARIZE",
parameters={
"text": "Very long article text here...",
"max_tokens": 200,
}
)
response = adapter.send(msg)msg = PulseMessage(
action="ACT.QUERY.DATA",
parameters={
"query": "Explain recursion",
"system_prompt": "You are a CS professor. Use simple analogies.",
}
)
response = adapter.send(msg)msg = PulseMessage(
action="ACT.CREATE.TEXT",
parameters={
"instructions": "Write a poem about AI",
"model": "gemini-2.0-pro",
"temperature": 0.9,
}
)
response = adapter.send(msg)| Parameter | Description | Default |
|---|---|---|
model |
Override the default model | gemini-2.0-flash |
temperature |
Creativity (0.0 - 2.0) | 0.7 |
max_tokens |
Max response length | 1000 |
system_prompt |
Custom system instruction | per-action |
target_language |
For translation action | required |
- Free tier — 15 requests/minute, no credit card needed
- Fast — Gemini 2.0 Flash is one of the fastest models
- Multimodal — text, images, video, audio (PULSE text actions work out of the box)
- Google ecosystem — integrates with Vertex AI for enterprise
pytest tests/ -q # All tests mocked, no API key needed| Package | Provider | Install |
|---|---|---|
| pulse-protocol | Core | pip install pulse-protocol |
| pulse-openai | OpenAI | pip install pulse-openai |
| pulse-anthropic | Anthropic | pip install pulse-anthropic |
| pulse-gemini | pip install pulse-gemini |
|
| pulse-binance | Binance | pip install pulse-binance |
| pulse-bybit | Bybit | pip install pulse-bybit |
| pulse-kraken | Kraken | pip install pulse-kraken |
| pulse-okx | OKX | pip install pulse-okx |
| pulse-gateway | Gateway | pip install pulse-gateway |
Apache 2.0 — open source, free forever.