{"_id":"@elizaos/plugin-google-genai-root","_rev":"4-6e50fa3f883336d787707af5e76cfcf1","name":"@elizaos/plugin-google-genai-root","dist-tags":{"next":"2.0.0-alpha.1","latest":"2.0.0-alpha.1"},"versions":{"2.0.0-alpha.1":{"name":"@elizaos/plugin-google-genai-root","version":"2.0.0-alpha.1","keywords":[],"author":{"name":"elizaOS"},"license":"MIT","_id":"@elizaos/plugin-google-genai-root@2.0.0-alpha.1","maintainers":[{"name":"shawticus","email":"shawmakesmagic@gmail.com"},{"name":"shakkernerd","email":"shakkerdroid@gmail.com"},{"name":"wtfsayo","email":"hi@sayo.wtf"},{"name":"odilitime","email":"janesmith@airmail.cc"},{"name":"cjft","email":"cjft@trimboli.io"}],"homepage":"https://github.com/elizaos-plugins/plugin-google-genai#readme","bugs":{"url":"https://github.com/elizaos-plugins/plugin-google-genai/issues"},"dist":{"shasum":"5adb8debf48921e1168d664fa5f771a544d562f5","tarball":"https://registry.npmjs.org/@elizaos/plugin-google-genai-root/-/plugin-google-genai-root-2.0.0-alpha.1.tgz","fileCount":57,"integrity":"sha512-YFBqs2L5L+dtV1C8OKCO/yz1ekK+b4zqTUdS0TqUkbMHh984ohTj6SFNCKweY2+NUJTmQYPgSOCY5LCOUot4GQ==","signatures":[{"sig":"MEUCIQCwXCZZtKUqT03roeNvTQ4TcgG7LnGMZnnGsEU4wbc4CgIgYCa8Oo55clp6uqMgvpA0e23BdlFqmIeITy2c0Z2aP4k=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":481619},"main":"typescript/dist/index.js","type":"module","types":"typescript/dist/index.d.ts","exports":{".":{"types":"./typescript/dist/index.d.ts","import":"./typescript/dist/index.js","default":"./typescript/dist/index.js"},"./rust":{"import":"./rust/pkg/node/elizaos_plugin_plugin_google_genai.js"},"./package.json":"./package.json"},"gitHead":"05d4ca11d769db8c7f54a722ee24b2ce2b951543","scripts":{"dev":"cd typescript && bun --hot build.ts","lint":"bunx @biomejs/biome check --write ./typescript","test":"bun run test:ts && bun run test:rust && bun run test:python","build":"bun run build:ts && bun run build:rust && bun run build:python","clean":"rm -rf typescript/dist python/dist rust/target .turbo node_modules","test:ts":"cd typescript && vitest run || echo 'TypeScript tests skipped - no tests found'","build:ts":"cd typescript && bun run build.ts","lint:rust":"test -d rust && cd rust && cargo clippy --all-targets --fix --allow-dirty --allow-staged -- -D warnings && cargo fmt || echo 'Rust lint skipped'","test:rust":"test -d rust && cd rust && cargo test || echo 'Rust tests skipped'","typecheck":"tsc --noEmit -p typescript/tsconfig.json","build:rust":"test -d rust && cd rust && cargo build --release || echo 'Rust build skipped - no rust directory'","lint:check":"bunx @biomejs/biome check ./typescript","lint:python":"test -d python && cd python && ruff check --fix . && ruff format . || echo 'Python lint skipped'","test:python":"test -d python && cd python && pytest -p no:anchorpy --asyncio-mode=auto || echo 'Python tests skipped'","build:python":"test -d python && cd python && (python3 -m build 2>/dev/null || pyproject-build) || echo 'Python build skipped - no python directory'","lint:python:fix":"test -d python && cd python && ruff check --fix . && ruff format . || echo 'Python lint fix skipped'"},"_npmUser":{"name":"shawticus","email":"shawmakesmagic@gmail.com"},"repository":{"url":"git+https://github.com/elizaos-plugins/plugin-google-genai.git","type":"git"},"_npmVersion":"lerna/9.0.3/node@v22.20.0+arm64 (darwin)","agentConfig":{"pluginType":"elizaos:plugin:1.0.0","pluginParameters":{"IMAGE_MODEL":{"type":"string","default":"gemini-2.0-flash-001","required":false,"sensitive":false,"description":"General fallback environment variable for the image model name when GOOGLE_IMAGE_MODEL is not set."},"LARGE_MODEL":{"type":"string","default":"gemini-2.0-flash-001","required":false,"sensitive":false,"description":"General fallback environment variable for the large model name when GOOGLE_LARGE_MODEL is not set."},"SMALL_MODEL":{"type":"string","default":"gemini-2.0-flash-001","required":false,"sensitive":false,"description":"General fallback environment variable for the small model name when GOOGLE_SMALL_MODEL is not set."},"GOOGLE_IMAGE_MODEL":{"type":"string","default":"gemini-2.0-flash-001","required":false,"sensitive":false,"description":"Overrides the default image analysis model used by Google Generative AI."},"GOOGLE_LARGE_MODEL":{"type":"string","default":"gemini-2.0-flash-001","required":false,"sensitive":false,"description":"Overrides the default large language model used for complex text/object generation."},"GOOGLE_SMALL_MODEL":{"type":"string","default":"gemini-2.0-flash-001","required":false,"sensitive":false,"description":"Overrides the default small language model used for fast text/object generation."},"GOOGLE_EMBEDDING_MODEL":{"type":"string","default":"text-embedding-004","required":false,"sensitive":false,"description":"Overrides the default text embedding model used by Google Generative AI."},"GOOGLE_GENERATIVE_AI_API_KEY":{"type":"string","required":true,"sensitive":true,"description":"API key for Google Generative AI (Gemini) obtained from Google AI Studio."}}},"description":"Google Generative AI (Gemini) plugin for elizaOS with native support for TypeScript, Python, and Rust.","directories":{},"_nodeVersion":"22.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.3.5","typescript":"^5.9.3","@types/node":"^25.0.3","@biomejs/biome":"^2.3.11"},"peerDependencies":{"@elizaos/core":"2.0.0-alpha.1"},"_npmOperationalInternal":{"tmp":"tmp/plugin-google-genai-root_2.0.0-alpha.1_1769033826476_0.1804324700946347","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-01-21T22:17:06.417Z","modified":"2026-06-16T05:14:25.985Z","2.0.0-alpha.1":"2026-01-21T22:17:06.678Z"},"bugs":{"url":"https://github.com/elizaos-plugins/plugin-google-genai/issues"},"author":{"name":"elizaOS"},"license":"MIT","homepage":"https://github.com/elizaos-plugins/plugin-google-genai#readme","keywords":[],"repository":{"url":"git+https://github.com/elizaos-plugins/plugin-google-genai.git","type":"git"},"description":"Google Generative AI (Gemini) plugin for elizaOS with native support for TypeScript, Python, and Rust.","maintainers":[{"email":"shawmakesmagic@gmail.com","name":"shawticus"},{"email":"janesmith@airmail.cc","name":"odilitime"}],"readme":"# @elizaos/plugin-google-genai\n\nGoogle Generative AI (Gemini) plugin for elizaOS with native support for TypeScript, Python, and Rust.\n\n## Features\n\n- **Text Generation**: Generate text using Gemini 2.0 Flash and 2.5 Pro models\n- **Embeddings**: Generate text embeddings with text-embedding-004\n- **Image Analysis**: Analyze and describe images with multimodal capabilities\n- **JSON Object Generation**: Generate structured JSON with schema validation\n- **Multi-Language Support**: Native implementations in TypeScript, Python, and Rust\n\n## Available Models\n\n| Model Type        | Default Model                | Description                        |\n| ----------------- | ---------------------------- | ---------------------------------- |\n| TEXT_SMALL        | gemini-2.0-flash-001         | Fast, efficient for everyday tasks |\n| TEXT_LARGE        | gemini-2.5-pro-preview-03-25 | Most capable for complex tasks     |\n| TEXT_EMBEDDING    | text-embedding-004           | Text embeddings (768 dimensions)   |\n| IMAGE_DESCRIPTION | gemini-2.5-pro-preview-03-25 | Multimodal image analysis          |\n| OBJECT_SMALL      | gemini-2.0-flash-001         | Fast JSON generation               |\n| OBJECT_LARGE      | gemini-2.5-pro-preview-03-25 | Complex JSON generation            |\n\n## Installation\n\n### TypeScript/JavaScript (npm)\n\n```bash\nnpm install @elizaos/plugin-google-genai\n# or\nbun add @elizaos/plugin-google-genai\n```\n\n### Python (PyPI)\n\n```bash\npip install elizaos-plugin-google-genai\n```\n\n### Rust (crates.io)\n\n```toml\n[dependencies]\nelizaos-plugin-google-genai = \"1.0\"\n```\n\n## Configuration\n\nSet the following environment variables:\n\n| Variable                       | Required | Description                                                                  |\n| ------------------------------ | -------- | ---------------------------------------------------------------------------- |\n| `GOOGLE_GENERATIVE_AI_API_KEY` | Yes      | Your Google AI API key from [Google AI Studio](https://aistudio.google.com/) |\n| `GOOGLE_SMALL_MODEL`           | No       | Override small model (default: gemini-2.0-flash-001)                         |\n| `GOOGLE_LARGE_MODEL`           | No       | Override large model (default: gemini-2.5-pro-preview-03-25)                 |\n| `GOOGLE_EMBEDDING_MODEL`       | No       | Override embedding model (default: text-embedding-004)                       |\n| `GOOGLE_IMAGE_MODEL`           | No       | Override image analysis model                                                |\n| `GOOGLE_TIMEOUT_SECONDS`       | No       | Request timeout (default: 60)                                                |\n\n## Usage\n\n### TypeScript (elizaOS Plugin)\n\n```typescript\nimport { googleGenAIPlugin } from \"@elizaos/plugin-google-genai\";\n\n// Register the plugin with your elizaOS agent\nconst agent = new Agent({\n  plugins: [googleGenAIPlugin],\n});\n\n// Use via runtime\nconst text = await runtime.useModel(ModelType.TEXT_LARGE, {\n  prompt: \"Explain quantum mechanics in simple terms.\",\n});\n\nconst embedding = await runtime.useModel(ModelType.TEXT_EMBEDDING, {\n  text: \"Hello, world!\",\n});\n\nconst object = await runtime.useModel(ModelType.OBJECT_SMALL, {\n  prompt: \"Generate a person profile with name and age.\",\n  schema: {\n    type: \"object\",\n    properties: {\n      name: { type: \"string\" },\n      age: { type: \"number\" },\n    },\n  },\n});\n```\n\n### Python\n\n```python\nimport asyncio\nfrom elizaos_plugin_google_genai import GoogleGenAIClient, GoogleGenAIConfig\n\nasync def main():\n    # Load config from environment\n    config = GoogleGenAIConfig.from_env()\n\n    async with GoogleGenAIClient(config) as client:\n        # Generate text\n        response = await client.generate_text_large(\"What is the meaning of life?\")\n        print(response.text)\n\n        # Generate embeddings\n        embedding = await client.generate_embedding(\"Hello, world!\")\n        print(f\"Embedding dimension: {len(embedding.embedding)}\")\n\n        # Generate structured JSON\n        from elizaos_plugin_google_genai import ObjectGenerationParams\n\n        result = await client.generate_object_small(ObjectGenerationParams(\n            prompt=\"Generate a person profile with name and age\",\n            json_schema={\n                \"type\": \"object\",\n                \"properties\": {\n                    \"name\": {\"type\": \"string\"},\n                    \"age\": {\"type\": \"number\"}\n                }\n            }\n        ))\n        print(result.object)\n\nasyncio.run(main())\n```\n\n### Rust\n\n```rust\nuse elizaos_plugin_google_genai::{\n    GoogleGenAIClient, GoogleGenAIConfig, TextGenerationParams,\n    EmbeddingParams, ObjectGenerationParams,\n};\n\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    // Load config from environment\n    let config = GoogleGenAIConfig::from_env()?;\n    let client = GoogleGenAIClient::new(config)?;\n\n    // Generate text\n    let params = TextGenerationParams::new(\"What is the meaning of life?\");\n    let response = client.generate_text_large(params).await?;\n    println!(\"Response: {}\", response.text);\n\n    // Generate embeddings\n    let params = EmbeddingParams::new(\"Hello, world!\");\n    let embedding = client.generate_embedding(params).await?;\n    println!(\"Embedding dimension: {}\", embedding.embedding.len());\n\n    // Generate structured JSON\n    let params = ObjectGenerationParams::new(\"Generate a person profile with name and age\")\n        .with_schema(serde_json::json!({\n            \"type\": \"object\",\n            \"properties\": {\n                \"name\": {\"type\": \"string\"},\n                \"age\": {\"type\": \"number\"}\n            }\n        }));\n    let result = client.generate_object_small(params).await?;\n    println!(\"Object: {}\", result.object);\n\n    Ok(())\n}\n```\n\n## Project Structure\n\n```\nplugin-google-genai/\n├── typescript/          # TypeScript implementation\n│   ├── index.ts         # Main plugin entry\n│   ├── models/          # Model handlers\n│   ├── utils/           # Utility functions\n│   └── __tests__/       # Unit and integration tests\n├── python/              # Python implementation\n│   ├── elizaos_plugin_google_genai/\n│   │   ├── __init__.py\n│   │   ├── client.py    # API client\n│   │   ├── config.py    # Configuration\n│   │   ├── types.py     # Type definitions\n│   │   └── errors.py    # Error types\n│   ├── tests/           # Test suite\n│   └── pyproject.toml   # PyPI publishing config\n├── rust/                # Rust implementation\n│   ├── src/\n│   │   ├── lib.rs       # Main library entry\n│   │   ├── client.rs    # API client\n│   │   ├── config.rs    # Configuration\n│   │   ├── types.rs     # Type definitions\n│   │   └── error.rs     # Error types\n│   ├── tests/           # Integration tests\n│   └── Cargo.toml       # crates.io publishing config\n├── package.json         # npm publishing config\n└── README.md            # This file\n```\n\n## Development\n\n### TypeScript\n\n```bash\n# Install dependencies\nbun install\n\n# Build\nbun run build\n\n# Run tests\nbun run test\n\n# Type checking\nbun run typecheck\n```\n\n### Python\n\n```bash\ncd python\n\n# Install dev dependencies\npip install -e \".[dev]\"\n\n# Run tests\npytest\n\n# Type checking\nmypy elizaos_plugin_google_genai\n\n# Linting\nruff check . && ruff format .\n```\n\n### Rust\n\n```bash\ncd rust\n\n# Build\ncargo build --release\n\n# Run tests\ncargo test\n\n# Lint\ncargo clippy --all-targets -- -D warnings\n\n# Build WASM\nwasm-pack build --target web --out-dir pkg/web\nwasm-pack build --target nodejs --out-dir pkg/node\n```\n\n## Publishing\n\n### npm (TypeScript)\n\n```bash\nnpm publish --access public\n```\n\n### PyPI (Python)\n\n```bash\ncd python\npython -m build\ntwine upload dist/*\n```\n\n### crates.io (Rust)\n\n```bash\ncd rust\ncargo publish\n```\n\n## License\n\nMIT\n\n## Contributing\n\nSee the main [elizaOS contribution guidelines](https://github.com/elizaos/eliza/blob/main/CONTRIBUTING.md).\n","readmeFilename":"README.md"}