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.2.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.2-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pangea_anthropic-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 89671fdd43536dac048dd70d76fa15e4acc205fbbbd3b5c1cbc6a4f113967e4a
MD5 8a999f85e5a3e3651ed5c4f39fda3a46
BLAKE2b-256 e6fdfe7c36ca4f627f2fc53257359b07ff62679c5a8e0dbeed7a414a8c45544c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pangea_anthropic-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a9559197accb53bca478ff5704ba76e978bb0999be4e370ef08bfd23c9d942fc
MD5 9eb46d9d1586fdeca38dd1edfbee5ff1
BLAKE2b-256 883b05e0744ec6a16e4f6c3b60f3bc5df28cbc726df7202c4761cb21f9f68e49

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