React Agent
An AI coding agent using the ReAct pattern (Reason-Act-Observe) with Claude and tool calling.
Install
pip install blocks-agent
Usage
from blocks_agent import AgentClient, AgentOptions
with AgentClient(AgentOptions(system_prompt="You are a helpful assistant.")) as client:
response = client.send("What files are in the current directory?")
print(response.text)
Async
import asyncio
from blocks_agent import AsyncAgentClient, AgentOptions
async def main():
async with AsyncAgentClient(AgentOptions()) as client:
response = await client.send("Summarize this project.")
print(response.text)
asyncio.run(main())
Streaming
from blocks_agent import AgentClient, AgentOptions
with AgentClient(AgentOptions()) as client:
for update in client.stream("List all Python files, then count them."):
print(f"[turn] {update.text[:120]}...")
print(f" stop_reason={update.stop_reason}")
Configuration
AgentOptions(
system_prompt="...", # Custom system prompt
model="claude-opus-4-6", # Model to use
max_turns=100, # Max ReAct iterations
cwd="/path/to/project", # Working directory
api_key="sk-...", # Or set ANTHROPIC_API_KEY env var
sandbox=True, # Restrict file access to cwd
)
Metadata
Release files for blocks-agent 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| blocks_agent-0.1.0.tar.gz | 22.7 kB | Without provenance | Details for blocks_agent-0.1.0.tar.gz |
Release files / blocks_agent-0.1.0.tar.gz
| Download URL | blocks_agent-0.1.0.tar.gz |
|---|---|
| Size | 22.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
384b93937814dd7686b9a39aa6d1f0afb47af84aed867527f80e08705c580460
|
|
BLAKE2b-256 checksum How to use checksums |
0132d83385213d2e5528d4e8e190d41d2e81486c86cf7368e153b19b47e55b4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.11
|
Security for blocks-agent 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.