Skip to main content

A wrapper around the Anthropic Python library

Project description

Pangea + Anthropic Python API library

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

Installation

pip install -U pangea-anthropic

Usage

import os
from pangea_anthropic import PangeaAnthropic

client = PangeaAnthropic(
    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("ANTHROPIC_API_KEY"),
)

message = client.messages.create(
    max_tokens=1024,
    messages=[
        {
            "role": "user",
            "content": "Hello, Claude",
        }
    ],
    model="claude-sonnet-4-20250514",
)
print(message.content)

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_anthropic-0.2.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

pangea_anthropic-0.2.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file pangea_anthropic-0.2.0.tar.gz.

File metadata

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

File hashes

Hashes for pangea_anthropic-0.2.0.tar.gz
Algorithm Hash digest
SHA256 128aaddebaa40aad81026003e5873897176302aca13fc6133716a76a2a316993
MD5 5f51149c470bd78d20bbf053ed4f1222
BLAKE2b-256 50131b5d6203098957b326499bd197e36898accfddca2080b42ac2da57427399

See more details on using hashes here.

File details

Details for the file pangea_anthropic-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pangea_anthropic-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6143ab4aee0f007a149a5e5060c9922bc19bb2feb2ec072068bb9ebcb91d97f
MD5 c6052e34d4cbe63283cd6daf860e9e1a
BLAKE2b-256 86c9254e1c0d7e375c380b847ba48ab9076ffc0af1c27ecb41f1e0814fb3c025

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