Unified minimal client for OpenAI and Google Gemini responses
Project description
genai-client
A tiny Python wrapper that unifies calls to OpenAI and Google Gemini with a simple, consistent interface.
Features
- Unified interface:
OpenAIClientandGoogleAIClientshare a similar API - Batteries-included examples: minimal scripts and tests to verify setup
- Type hints: ships
py.typed
Installation
pip install genai-client
Requirements
- Python >= 3.10
- API keys
- OpenAI:
OPENAI_API_KEY— get one at OpenAI API keys - Google Gemini:
GEMINI_API_KEY— create at Google AI Studio API keys
- OpenAI:
Put keys in a .env at the project root (optional):
OPENAI_API_KEY=sk-...
GEMINI_API_KEY=...
Quick start
from genai_client import OpenAIClient, GoogleAIClient
openai_client = OpenAIClient(api_key="<OPENAI_API_KEY>")
print(openai_client.get_response("Say hi in one word"))
google_client = GoogleAIClient(api_key="<GEMINI_API_KEY>")
print(google_client.get_response("Say hi in one word"))
Or run the included example (loads .env automatically):
python example.py
API
OpenAIClient(api_key: str)get_response(prompt: str) -> str(uses OpenAI Responses API with modelo4-mini)- Official docs: OpenAI Python SDK, Responses API
GoogleAIClient(api_key: str)get_response(prompt: str) -> str(streams text fromgemini-2.5-flash)- Official docs: Gemini API for Python, google-genai SDK
Tests / smoke checks
# ensure .env has required keys
python tests/test_openai.py
python tests/test_gemini.py
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
genai_client-0.1.2.tar.gz
(49.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file genai_client-0.1.2.tar.gz.
File metadata
- Download URL: genai_client-0.1.2.tar.gz
- Upload date:
- Size: 49.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b62b24fb8dd22b5d4b4827a1a81a50f7ec06e6299fc876ac35cf7374423400c1
|
|
| MD5 |
b41077d3d6fc12e3cfbd5af80c37fb84
|
|
| BLAKE2b-256 |
faf4979b6181e27d3000992246ab4c1597185a0547b70b4e9541542354d3a511
|
File details
Details for the file genai_client-0.1.2-py3-none-any.whl.
File metadata
- Download URL: genai_client-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c0700b5321c854794e87a1bb716cbe0aaee61d251894c6b81b88dfdd3f10805
|
|
| MD5 |
dda38d4d1e082e93af555b21a7f0b64c
|
|
| BLAKE2b-256 |
9ac39002d575fb0dd2d858b4aec4e07b6fd1679ce07626a82dbfcf832d1a4b04
|