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

Uploaded Python 3

File details

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

File metadata

  • Download URL: purra_anthropic-0.5.0.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.0.tar.gz
Algorithm Hash digest
SHA256 59fe4ac6e6cbda629fb28edb48adff6b4cb9f9e197cdfa8b925ba7203708b8b8
MD5 7e6044df910365281135e30005c9c07c
BLAKE2b-256 977ba05e5876416d15be2ce25e21ad3f4d7476886fa6a214e44b48968e9a5dd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for purra_anthropic-0.5.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for purra_anthropic-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6efea9f6618af2dd8e8552f7fd8041c28e154fb93fe1c4a662a7db6df78d38e7
MD5 52d7b271dcf0101a38d546e40d389d39
BLAKE2b-256 c56b0b638cee77bb106f0ba29c04baa5e17abc92fa1c83c8186509256ccd9bb5

See more details on using hashes here.

Provenance

The following attestation bundles were made for purra_anthropic-0.5.0-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

0.5.1

2 files

This release

0.5.0 This release

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