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.0.tar.gz (9.3 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.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pangea_anthropic-0.1.0.tar.gz
Algorithm Hash digest
SHA256 42e9ee5633e0ffaf9c63d7e58d9f30953b9781b560a850f4060c4adaf71cd7c0
MD5 804347d9e0a24e9f855d55572b0e01c9
BLAKE2b-256 096873e5a04b8190833f1d7bb3048e1840ff82554564a69aef675c5ada95a33b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pangea_anthropic-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a63ec06f53a813011ba9f7d2a2facc1c6679f4219df7ecb6fbf20ebdc9081a2
MD5 5f597930ff3158e6c8a5ec74a04af795
BLAKE2b-256 65660f169b888373d0c6971a58a4e4495d2cf3c65b91ec2c5fbcacd2321962a5

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