Skip to main content

PULSE-Gemini

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).

Quick Start

pip install pulse-gemini
from 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"])

Switch Providers in One Line

# 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.

Supported Actions

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

Examples

Analyze sentiment

msg = PulseMessage(
    action="ACT.ANALYZE.SENTIMENT",
    parameters={"text": "This is the best day ever!"}
)
response = adapter.send(msg)

Translate text

msg = PulseMessage(
    action="ACT.TRANSFORM.TRANSLATE",
    parameters={"text": "Hello, world!", "target_language": "German"}
)
response = adapter.send(msg)

Summarize a long text

msg = PulseMessage(
    action="ACT.TRANSFORM.SUMMARIZE",
    parameters={
        "text": "Very long article text here...",
        "max_tokens": 200,
    }
)
response = adapter.send(msg)

Custom system prompt

msg = PulseMessage(
    action="ACT.QUERY.DATA",
    parameters={
        "query": "Explain recursion",
        "system_prompt": "You are a CS professor. Use simple analogies.",
    }
)
response = adapter.send(msg)

Use a different model

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)

Parameters

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

Why Gemini?

  • 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

Testing

pytest tests/ -q  # All tests mocked, no API key needed

PULSE Ecosystem

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 Google 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

License

Apache 2.0 — open source, free forever.

Metadata

Release files for pulse-gemini 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pulse-gemini 0.1.0
File Size Uploaded Provenance Actions
pulse_gemini-0.1.0.tar.gz 10.0 kB Without provenance Details for pulse_gemini-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pulse-gemini 0.1.0
File Interpreter ABI Platform Actions
pulse_gemini-0.1.0-py3-none-any.whl Python 3 none any Details for pulse_gemini-0.1.0-py3-none-any.whl

Total release size: 16.9 kB

Release files / pulse_gemini-0.1.0.tar.gz

Download URL pulse_gemini-0.1.0.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8a2be9069e3df5198916aa36cdeb0b2f733ac25345584c667ef0a35a9540582c
BLAKE2b-256 checksum
How to use checksums
12c2c985bf35850853a632aa57bfb9607bac0c144233f49a16ef05d9a48596a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release files / pulse_gemini-0.1.0-py3-none-any.whl

Download URL pulse_gemini-0.1.0-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
391dc431fe8add9ef3d116c12abc4e67dfada3228d8011c683471be473485dca
BLAKE2b-256 checksum
How to use checksums
93a589eb419c56a33459a732ca1163df461d1fd6d58bc1cc558ae416981fc1c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Security for pulse-gemini 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page