Skip to main content

Pangea + boto3

A wrapper around boto3's Bedrock Runtime client that wraps the converse API with Pangea AI Guard. Supports Python v3.10 and greater.

Installation

pip install -U pangea-boto3

Usage

import os

import boto3

from pangea_boto3 import converse

# Create a Bedrock Runtime client.
brt = boto3.client("bedrock-runtime")

# Use pangea_boto3's `converse()` function instead of `brt.converse()`.
response = converse(
    # Pass the Bedrock Runtime client.
    brt,
    # Pangea arguments.
    pangea_api_key=os.getenv("PANGEA_API_KEY", ""),
    pangea_input_recipe="pangea_prompt_guard",
    pangea_output_recipe="pangea_llm_response_guard",
    # `converse()` arguments.
    modelId="anthropic.claude-3-5-sonnet-20240620-v1:0",
    messages=[{"role": "user", "content": [{"text": "Describe the purpose of a 'hello world' program in one line."}]}],
    inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9},
    # ...
)

print(response["output"])

Metadata

Release files for pangea-boto3 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pangea-boto3 0.2.0
File Size Uploaded Provenance
pangea_boto3-0.2.0.tar.gz 2.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pangea-boto3 0.2.0
File Interpreter ABI Platform
pangea_boto3-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 5.9 kB

Release files / pangea_boto3-0.2.0.tar.gz

Download URL pangea_boto3-0.2.0.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5bf1d73628d34f54977b6eb9d27c0cc0f9bfe57fbf3c42df2e77cd82dd045eb1
BLAKE2b-256 checksum
How to use checksums
4b10eba68caf1d32ea9a8d541a9e377f337b4aa7d73ffaceed69313647edab38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / pangea_boto3-0.2.0-py3-none-any.whl

Download URL pangea_boto3-0.2.0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f67f5048251020068b3c35ba5069056675a59de72ad9ee3f355a1897b6eac82
BLAKE2b-256 checksum
How to use checksums
c20f97ca53736d47ad738d5aa72dc364f47ce9a3c4fc9c9ad364d0e943c782c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for pangea-boto3 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page