Metadata-Version: 2.4
Name: elizaos-plugin-google-genai
Version: 2.0.0a4
Summary: elizaOS Google GenAI Plugin - Gemini API client for text generation, embeddings, and image analysis
Project-URL: Homepage, https://github.com/elizaos/eliza
Project-URL: Documentation, https://elizaos.ai/docs
Project-URL: Repository, https://github.com/elizaos/eliza
Author: elizaOS Contributors
License-Expression: MIT
License-File: LICENSE
Keywords: agents,ai,elizaos,embeddings,gemini,genai,google,llm
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.10.0
Provides-Extra: dev
Requires-Dist: mypy>=1.19.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
Requires-Dist: pytest-cov>=6.0.0; extra == 'dev'
Requires-Dist: pytest-xprocess>=1.0.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: python-dotenv>=1.0.0; extra == 'dev'
Requires-Dist: ruff>=0.14.0; extra == 'dev'
Description-Content-Type: text/markdown

# elizaOS Google GenAI Plugin (Python)

Python implementation of the elizaOS Google Generative AI plugin for Gemini models.

## Installation

```bash
pip install elizaos-plugin-google-genai
```

## Quick Start

```python
import asyncio
from elizaos_plugin_google_genai import GoogleGenAIClient, GoogleGenAIConfig

async def main():
    # Load config from environment
    config = GoogleGenAIConfig.from_env()

    async with GoogleGenAIClient(config) as client:
        # Generate text
        response = await client.generate_text_large("What is the meaning of life?")
        print(response.text)

        # Generate embeddings
        embedding = await client.generate_embedding("Hello, world!")
        print(f"Embedding dimension: {len(embedding.embedding)}")

        # Generate structured JSON
        from elizaos_plugin_google_genai import ObjectGenerationParams

        result = await client.generate_object_small(ObjectGenerationParams(
            prompt="Generate a person profile with name and age",
            json_schema={
                "type": "object",
                "properties": {
                    "name": {"type": "string"},
                    "age": {"type": "number"}
                }
            }
        ))
        print(result.object)

asyncio.run(main())
```

## Configuration

Set the following environment variables:

| Variable                       | Required | Description                                                  |
| ------------------------------ | -------- | ------------------------------------------------------------ |
| `GOOGLE_GENERATIVE_AI_API_KEY` | Yes      | Your Google AI API key                                       |
| `GOOGLE_SMALL_MODEL`           | No       | Override small model (default: gemini-2.0-flash-001)         |
| `GOOGLE_LARGE_MODEL`           | No       | Override large model (default: gemini-2.5-pro-preview-03-25) |
| `GOOGLE_EMBEDDING_MODEL`       | No       | Override embedding model (default: text-embedding-004)       |
| `GOOGLE_IMAGE_MODEL`           | No       | Override image model                                         |
| `GOOGLE_TIMEOUT_SECONDS`       | No       | Request timeout (default: 60)                                |

## Features

- **Text Generation**: Generate text using Gemini models
- **Embeddings**: Generate text embeddings for semantic search
- **Image Analysis**: Analyze and describe images
- **JSON Object Generation**: Generate structured JSON with schema validation
- **Async/Await**: Full async support for efficient I/O
- **Type Safety**: Full type hints with Pydantic models

## Development

```bash
# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Type checking
mypy elizaos_plugin_google_genai

# Linting
ruff check .
ruff format .
```

## License

MIT



