Skip to main content

A wrapper around the OpenAI Python library that wraps the Responses API with Pangea AI Guard

Project description

Pangea + OpenAI Python API library

A wrapper around the OpenAI Python library that wraps the Responses API with Pangea AI Guard. Supports Python v3.10 and greater.

Installation

pip install -U pangea-openai

Usage

import os
from pangea_openai import PangeaOpenAI

client = PangeaOpenAI(
    pangea_api_key=os.environ.get("PANGEA_API_KEY"),
    pangea_input_recipe="pangea_prompt_guard",
    pangea_output_recipe="pangea_llm_response_guard",
    api_key=os.environ.get("OPENAI_API_KEY"),
)

response = client.responses.create(
    model="gpt-4o",
    instructions="You are a coding assistant that talks like a pirate.",
    input="How do I check if a Python object is an instance of a class?",
)

print(response.output_text)

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_openai-0.1.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

pangea_openai-0.1.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file pangea_openai-0.1.0.tar.gz.

File metadata

  • Download URL: pangea_openai-0.1.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pangea_openai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 50220b48174fca8429712f626108861d935c1efa8bdc6492b043b04227f7b13c
MD5 e4e6f2898773060abb8f2e6944dd955b
BLAKE2b-256 39f0988530a706179b1fb6624cf7e7ff94dc870b9d12477cd72efe9d0c867f2b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pangea_openai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pangea_openai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d05401b4e6b5925d19f61cd9a6ad280ea987446780f6edc1753a25f131506ae
MD5 9f5fc22b2349dc726d2a46311eb73f5b
BLAKE2b-256 52fb0bc0b5a9a75d800f896d5fc4f5f7e621d2e040db1d57194e90871f54b013

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