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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59fe4ac6e6cbda629fb28edb48adff6b4cb9f9e197cdfa8b925ba7203708b8b8
|
|
| MD5 |
7e6044df910365281135e30005c9c07c
|
|
| BLAKE2b-256 |
977ba05e5876416d15be2ce25e21ad3f4d7476886fa6a214e44b48968e9a5dd8
|
Provenance
The following attestation bundles were made for purra_anthropic-0.5.0.tar.gz:
Publisher:
release.yml on Lybrands/purra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
purra_anthropic-0.5.0.tar.gz -
Subject digest:
59fe4ac6e6cbda629fb28edb48adff6b4cb9f9e197cdfa8b925ba7203708b8b8 - Sigstore transparency entry: 2728622485
- Sigstore integration time:
-
Permalink:
Lybrands/purra@cd1a2fd6206999edf98a1a5b2047cca47517a64a -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/Lybrands
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cd1a2fd6206999edf98a1a5b2047cca47517a64a -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file purra_anthropic-0.5.0-py3-none-any.whl.
File metadata
- Download URL: purra_anthropic-0.5.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6efea9f6618af2dd8e8552f7fd8041c28e154fb93fe1c4a662a7db6df78d38e7
|
|
| MD5 |
52d7b271dcf0101a38d546e40d389d39
|
|
| BLAKE2b-256 |
c56b0b638cee77bb106f0ba29c04baa5e17abc92fa1c83c8186509256ccd9bb5
|
Provenance
The following attestation bundles were made for purra_anthropic-0.5.0-py3-none-any.whl:
Publisher:
release.yml on Lybrands/purra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
purra_anthropic-0.5.0-py3-none-any.whl -
Subject digest:
6efea9f6618af2dd8e8552f7fd8041c28e154fb93fe1c4a662a7db6df78d38e7 - Sigstore transparency entry: 2728623616
- Sigstore integration time:
-
Permalink:
Lybrands/purra@cd1a2fd6206999edf98a1a5b2047cca47517a64a -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/Lybrands
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cd1a2fd6206999edf98a1a5b2047cca47517a64a -
Trigger Event:
workflow_dispatch
-
Statement type: