Metadata-Version: 2.4
Name: pulse-gemini
Version: 0.1.0
Summary: Google Gemini adapter for PULSE Protocol — send PULSE messages, get Gemini responses
Author-email: PULSE Protocol Team <pulse@protocol.org>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/pulseprotocolorg-cyber/pulse-gemini
Project-URL: Repository, https://github.com/pulseprotocolorg-cyber/pulse-gemini
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: pulse-protocol>=0.5.0
Requires-Dist: google-genai>=1.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"

# 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

```bash
pip install pulse-gemini
```

```python
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

```python
# 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

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

### Translate text

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

### Summarize a long text

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

### Custom system prompt

```python
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

```python
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

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

## PULSE Ecosystem

| Package | Provider | Install |
|---|---|---|
| [pulse-protocol](https://pypi.org/project/pulse-protocol/) | Core | `pip install pulse-protocol` |
| [pulse-openai](https://pypi.org/project/pulse-openai/) | OpenAI | `pip install pulse-openai` |
| [pulse-anthropic](https://pypi.org/project/pulse-anthropic/) | Anthropic | `pip install pulse-anthropic` |
| **pulse-gemini** | **Google** | `pip install pulse-gemini` |
| [pulse-binance](https://pypi.org/project/pulse-binance/) | Binance | `pip install pulse-binance` |
| [pulse-bybit](https://pypi.org/project/pulse-bybit/) | Bybit | `pip install pulse-bybit` |
| [pulse-kraken](https://pypi.org/project/pulse-kraken/) | Kraken | `pip install pulse-kraken` |
| [pulse-okx](https://pypi.org/project/pulse-okx/) | OKX | `pip install pulse-okx` |
| [pulse-gateway](https://pypi.org/project/pulse-gateway/) | Gateway | `pip install pulse-gateway` |

## License

Apache 2.0 — open source, free forever.
