Easy AI Module
A simple Python package for personal use that makes it easy to interact with Google's Gemini AI API.
Installation
pip install -e .
Usage
First, replace the API_KEY in easy_ai_module/gemini_client.py with your actual Gemini API key.
Text Generation
from easy_ai_module import GeminiAI
ai = GeminiAI() # Defaults to gemini-2.0-flash
# Generate text from a prompt
response = ai.generate_text("Write a short story about a robot")
print(response)
# Customize parameters
response = ai.generate_text(
prompt="Write a haiku about the moon",
max_tokens=100,
temperature=0.3 # Lower temperature for more focused output
)
print(response)
Image Analysis
from easy_ai_module import GeminiAI
ai = GeminiAI()
# Analyze an image (requires valid image URL)
image_url = "https://example.com/image.jpg"
response = ai.generate_with_image("What's in this image?", image_url)
print(response)
Models
You can specify different Gemini models:
# Use Gemini 1.5 Flash
ai = GeminiAI(model="gemini-1.5-flash")
# Use Gemma 3
ai = GeminiAI(model="gemma-3")
# Use Gemini 2.0 Flash (default)
ai = GeminiAI(model="gemini-2.0-flash")
# Use Gemini 2.0 Flash-Lite
ai = GeminiAI(model="gemini-2.0-flash-lite")
Model Selection Guide
The package includes a helpful guide to select the right model for your needs:
# Show general help on model selection
from easy_ai_module import GeminiAI
GeminiAI.help()
# Get recommendation for a specific use case
GeminiAI.help('reasoning') # For complex reasoning tasks
GeminiAI.help('speed') # For fastest response times
GeminiAI.help('budget') # For cost-effective usage
GeminiAI.help('creative') # For creative content generation
GeminiAI.help('image') # For image analysis tasks
GeminiAI.help('local') # For models that can run locally
Detailed Model Information
For detailed information about model capabilities, strengths, and pricing:
from easy_ai_module import print_model_guide
# Show information about all models
print_model_guide()
# Show information about a specific model
print_model_guide('gemini-2.0-flash')
Testing Tools
The package includes tools for testing and benchmarking models:
# Run a simple test with the default model
python model_demo.py
# Show the detailed guide for all models
python model_demo.py --guide
# Show help for a specific use case
python model_demo.py --show-help --use-case creative
# Run benchmarks on all models
python model_demo.py --benchmark
# Test a specific model with a custom prompt
python model_demo.py --model gemini-2.0-flash-lite --prompt "Explain quantum computing"
# Run all tests (help menu, benchmarks, and model guide)
python model_demo.py --test-all --verbose
Note
This package is for personal use only and contains a hardcoded API key. Do not share it with others.
Metadata
Release files for easy-ai-module 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| easy_ai_module-0.1.2.tar.gz | 6.8 kB | Without provenance | Details for easy_ai_module-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| easy_ai_module-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for easy_ai_module-0.1.2-py3-none-any.whl |
Total release size: 14.7 kB
Release files / easy_ai_module-0.1.2.tar.gz
| Download URL | easy_ai_module-0.1.2.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0910d5fb8daf9367ccd7fd8d5876608c86468c0a15851e99714b1d6f9f411110
|
|
BLAKE2b-256 checksum How to use checksums |
5e2218cd1fc859f775f69b52fa0508f2f4675ada33e5e087f57e53d86c3ce520
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.9
|
Release files / easy_ai_module-0.1.2-py3-none-any.whl
| Download URL | easy_ai_module-0.1.2-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
683668dc214394051eabf7eb0fb609bf32ece4e7642967b459427ec1f489119a
|
|
BLAKE2b-256 checksum How to use checksums |
305fc18a23efbc366985cc659478a406d9a48ffb0cbc5bed4eca5f5d53f57e50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.9
|
Security for easy-ai-module 0.1.2
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.