A wrapper around the Google GenAI Python SDK
Project description
Pangea + Google Gen AI SDK
A wrapper around the Google Gen AI SDK that wraps the Gemini API with Pangea AI Guard. Supports Python v3.10 and greater.
Installation
pip install -U pangea-google-genai
Usage
import os
import pangea_google_genai as genai
client = genai.PangeaClient(
api_key=os.environ.get("GEMINI_API_KEY"),
pangea_api_key=os.environ.get("PANGEA_API_KEY"),
pangea_input_recipe="pangea_prompt_guard",
pangea_output_recipe="pangea_llm_response_guard",
)
response = client.models.generate_content(
model="gemini-2.5-flash",
contents="Explain how AI works in a few words",
)
print(response.text)
Note that AI Guard transformations on the LLM response are not applied because the conversion from Gemini API output to Pangea AI Guard input is lossy.
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
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 pangea_google_genai-0.1.0.tar.gz.
File metadata
- Download URL: pangea_google_genai-0.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae6d8d1d0e788694c8c29cbedd7ef109069397d2fae8e70e297feb17d7a4a787
|
|
| MD5 |
8293c2fa8fd512cb4ade871c5a32f8eb
|
|
| BLAKE2b-256 |
ba81562d08e204ef2f36c7082a7f4cb338c518030bba69df518dc23605bebf92
|
File details
Details for the file pangea_google_genai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pangea_google_genai-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1620368beb8660b43e505e17f5162900ebbec3c416da0051b8c67fb2a2138806
|
|
| MD5 |
f2c6c2a59535ea74d173fb106c4f536b
|
|
| BLAKE2b-256 |
255ac6e443cf869e70c8235764c6edebb7df4ec03046f1ceb15c5ed4ed3ef9b3
|