Skip to main content

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.

PyPI - Version Python Versions

Features

  • Unified interface: OpenAIClient and GoogleAIClient share a similar API
  • Batteries-included examples: minimal scripts and tests to verify setup
  • Type hints: ships py.typed

Installation

pip install genai-client

Requirements

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

Tests / smoke checks

# ensure .env has required keys
python tests/test_openai.py
python tests/test_gemini.py

License

MIT

Project details


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

genai_client-0.1.2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

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

Hashes for genai_client-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b62b24fb8dd22b5d4b4827a1a81a50f7ec06e6299fc876ac35cf7374423400c1
MD5 b41077d3d6fc12e3cfbd5af80c37fb84
BLAKE2b-256 faf4979b6181e27d3000992246ab4c1597185a0547b70b4e9541542354d3a511

See more details on using hashes here.

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

Hashes for genai_client-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4c0700b5321c854794e87a1bb716cbe0aaee61d251894c6b81b88dfdd3f10805
MD5 dda38d4d1e082e93af555b21a7f0b64c
BLAKE2b-256 9ac39002d575fb0dd2d858b4aec4e07b6fd1679ce07626a82dbfcf832d1a4b04

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page