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.1.1.tar.gz (9.1 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.1.1-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pangea_anthropic-0.1.1.tar.gz
  • Upload date:
  • Size: 9.1 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.1.1.tar.gz
Algorithm Hash digest
SHA256 1eae52ca589104241508b53e8f7c558b718a7e67b6e456b56533ac715eb14355
MD5 ec9ff989d8324b9a9a77fa378a9bc17c
BLAKE2b-256 763555bb23e3a8550e08a1543ecd140480472ebb76325444fc8bc8d6589cb1ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pangea_anthropic-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cf7935ea98d8a7f775d1fc88ad8a6af85d333c75cb63dd1695fd3e88fbc69eb6
MD5 cd530c7040e97b4a9e6b3c704c44e2c4
BLAKE2b-256 ff68f012c90a5af15014712fc634bf43a54a8efac2904ac45e4cef6ab321e262

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