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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

purra_anthropic-0.5.1.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

purra_anthropic-0.5.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file purra_anthropic-0.5.1.tar.gz.

File metadata

  • Download URL: purra_anthropic-0.5.1.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for purra_anthropic-0.5.1.tar.gz
Algorithm Hash digest
SHA256 6883eb4cd07e02387b37ecd7a1be3114640e5dba2339fba6e4c1aab91fefbb29
MD5 1fb3d2ef969ca5ec1f9e06bb5016b291
BLAKE2b-256 c57f230efc5e82af9ad3fc47445d5cd6be452349294fce940e512856a2a37962

See more details on using hashes here.

Provenance

The following attestation bundles were made for purra_anthropic-0.5.1.tar.gz:

Publisher: release.yml on Lybrands/purra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file purra_anthropic-0.5.1-py3-none-any.whl.

File metadata

File hashes

Hashes for purra_anthropic-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 69ba431ac17345f490aea96f1561e72b322caad5effe03c6904a2803d268dc45
MD5 2ad82888a560f94014552a15b62a73cf
BLAKE2b-256 91910ea57a068a0032370ab4f401b93c17dddbf244db51872c4c3d6bca0656e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for purra_anthropic-0.5.1-py3-none-any.whl:

Publisher: release.yml on Lybrands/purra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 files

0.5.0

2 files

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