Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pangea_google_genai-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

pangea_google_genai-0.1.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

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

Hashes for pangea_google_genai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ae6d8d1d0e788694c8c29cbedd7ef109069397d2fae8e70e297feb17d7a4a787
MD5 8293c2fa8fd512cb4ade871c5a32f8eb
BLAKE2b-256 ba81562d08e204ef2f36c7082a7f4cb338c518030bba69df518dc23605bebf92

See more details on using hashes here.

File details

Details for the file pangea_google_genai-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pangea_google_genai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1620368beb8660b43e505e17f5162900ebbec3c416da0051b8c67fb2a2138806
MD5 f2c6c2a59535ea74d173fb106c4f536b
BLAKE2b-256 255ac6e443cf869e70c8235764c6edebb7df4ec03046f1ceb15c5ed4ed3ef9b3

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