palmshed-sdk
Gemini AI client for Python. Text generation, chat, thinking, URL context, image generation, text-to-speech, and deep research.
Install
pip install palmshed-sdk
With optional dependencies:
pip install palmshed-sdk[redis] # Redis caching
pip install palmshed-sdk[vertex] # Vertex AI image generation
Usage
from palmshed_sdk import GeminiAI
client = GeminiAI(api_key="your-key")
# Simple text generation
response = client.generate_text("Write a haiku about Python")
# Chat with history
messages = [
{"role": "user", "content": "What is Flask?"},
{"role": "assistant", "content": "Flask is a lightweight web framework."},
{"role": "user", "content": "How do I install it?"},
]
response = client.generate_chat(messages)
# Thinking mode
result = client.generate_text_with_thinking("Explain quantum computing")
print(result["response"])
print(result["thinking_summary"])
# Text-to-speech
filepath = client.text_to_speech("Hello world")
# Image generation
result = client.generate_image("A sunset over the ocean")
print(result.filepath)
Configuration
from palmshed_sdk import GeminiAI, ModelConfig
# Custom model names
models = ModelConfig(
text="gemini-2.5-flash",
thinking="gemini-2.5-pro",
image="gemini-2.5-flash-image",
)
client = GeminiAI(
api_key="your-key",
models=models,
redis_url="redis://localhost:6379",
go_service_url="http://localhost:8080/process",
)
Environment Variables
| Variable | Description |
|---|---|
GEMINI_API_KEY |
Required. Your Gemini API key. |
REDIS_URL |
Optional. Redis URL for caching. |
IMAGE_PROVIDER |
Optional. Image provider: gemini, vertex, mock. |
IMAGE_MODEL |
Optional. Image model name. |
GOOGLE_CLOUD_PROJECT |
Optional. GCP project for Vertex AI. |
GOOGLE_CLOUD_LOCATION |
Optional. GCP location for Vertex AI. |
License
MIT
Metadata
Release files for palmshed-sdk 0.1.0
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 |
|---|---|---|---|---|
| palmshed_sdk-0.1.0.tar.gz | 21.5 kB | Without provenance | Details for palmshed_sdk-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| palmshed_sdk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for palmshed_sdk-0.1.0-py3-none-any.whl |
Total release size: 31.5 kB
Release files / palmshed_sdk-0.1.0.tar.gz
| Download URL | palmshed_sdk-0.1.0.tar.gz |
|---|---|
| Size | 21.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f71dae7b732a48316c9e30c61aae4223cb558e135f32fd1d3a49c4dd756660e0
|
|
BLAKE2b-256 checksum How to use checksums |
96e0f0f8a1938851e21759b48e644bc043bd8dac4f58811abc0c0e33cddb1765
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Release files / palmshed_sdk-0.1.0-py3-none-any.whl
| Download URL | palmshed_sdk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eac14ce842cc049e054863acbc457f8c207eba61c4e9859b0886f2d3671564f6
|
|
BLAKE2b-256 checksum How to use checksums |
5e849ab0d392078c58cb4bc9b6ec5f9e91b76cd9763e5e1b26d97cd29939ab9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Security for palmshed-sdk 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.