Skip to main content

purra-anthropic · Python

English | 简体中文

Anthropic Messages gateway for PurrA using the official Python SDK. Supports text, function tools, streaming, cancellation, and token usage. Requires Python 3.11+.

Install

From the repository root:

python -m pip install . ./integrations/anthropic/python

Configure

from anthropic import AsyncAnthropic
from purra_anthropic import AnthropicMessagesGateway

client = AsyncAnthropic()
gateway = AnthropicMessagesGateway(client, timeout_seconds=60)

Pass gateway to AgentCore(model_gateway=gateway, ...). In the Run's ModelRequest, set provider="anthropic", the model ID, and its capability snapshot. The application supplies credentials and verified model limits.

Model options

ModelRequest.options accepts max_tokens, temperature, top_p, top_k, thinking, and output_config. Choose options supported by the selected model.

Enabled reasoning requires an explicit thinking configuration, such as {"type": "adaptive"} on a supporting model. A manual budget_tokens must be at least 1024 and below the resolved output limit. Forced tool choice cannot be combined with enabled thinking.

Behavior

SDK retries are disabled; Core controls retry and budget accounting. The gateway applies Core's resolved output limit and combines system/developer instructions into Anthropic's system field.

Signed thinking and redacted blocks are retained as private continuation data. Keep them with the unchanged assistant message when continuing on the same model; they are excluded from public output. Input usage includes cache writes and reads.

Multimodal content, hosted tools, and beta APIs are not supported. Other vendors require application adapters. Close a supplied SDK client in the application; await gateway.close() only closes a client created by the gateway.

Metadata

Release files for purra-anthropic 1.0.3

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

Source distribution (sdist)

Source distribution for purra-anthropic 1.0.3
File Size Uploaded Provenance Actions
purra_anthropic-1.0.3.tar.gz 13.5 kB With provenance Details for purra_anthropic-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for purra-anthropic 1.0.3
File Interpreter ABI Platform Actions
purra_anthropic-1.0.3-py3-none-any.whl Python 3 none any Details for purra_anthropic-1.0.3-py3-none-any.whl

Total release size: 21.5 kB

Release files / purra_anthropic-1.0.3.tar.gz

Download URL purra_anthropic-1.0.3.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
55e4fd809f3e1ab466faa003d5c2f6b09f8fde652e546d071caf715ceb244aba
BLAKE2b-256 checksum
How to use checksums
dc921a25be0e8feac2a424958fa3a2372bb9897f3f2a846c870db056a7a7b599
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / purra_anthropic-1.0.3-py3-none-any.whl

Download URL purra_anthropic-1.0.3-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2404fadcefdc0c559b241844f47719e95a64bfd78f200aae370285d734ce02e2
BLAKE2b-256 checksum
How to use checksums
2cce6f25461a1cb9bfa4f933e6028efa6bace0206906ec8a55e93c31f592a0f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for purra-anthropic 1.0.3

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for purra_anthropic-1.0.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

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.

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