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.1.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.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file pangea_google_genai-0.1.1.tar.gz.

File metadata

  • Download URL: pangea_google_genai-0.1.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pangea_google_genai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e654784aa2aa3bc552e599a13f7823522a605ddec46a39bebaf5231d024b084f
MD5 e98919ce3e30d3ac1ddc12afd2718eea
BLAKE2b-256 f79993d8237885abde8255d7605dd45b200d4bf78866855c152a8a1b2e7a6ffb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pangea_google_genai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3a607beba15651e590674c10606b491209dfd6168f2a19f3bce9e46b51c5bf3e
MD5 111c4490995831595353c999b7400b01
BLAKE2b-256 79eda492f3a788b0e233cc32e3bb97eb7828c3f1f890dc936bd22b591ab40c25

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