Skip to main content

Argentor Python SDK

Pure-Python client for the Argentor AI agent framework.

Install

pip install -e python/

Requires Python 3.9+ and httpx.

Quick start

from argentor import Agent

agent = Agent(api_key="sk-ant-...", model="claude-3-5-sonnet-20241022")
response = agent.run("What is the capital of Argentina?")
print(response)

Set ANTHROPIC_API_KEY in your environment to omit api_key:

import os
os.environ["ANTHROPIC_API_KEY"] = "sk-ant-..."
agent = Agent()

Agent with skills (tool use)

def get_weather(city: str) -> str:
    return f"Sunny in {city}, 22C"

agent = Agent(api_key="sk-ant-...")
agent.add_skill(
    name="get_weather",
    description="Get the current weather for a city",
    fn=get_weather,
    parameters={
        "type": "object",
        "properties": {"city": {"type": "string"}},
        "required": ["city"],
    },
)

response = agent.run("What is the weather in Buenos Aires?")
print(response)

Async API

import asyncio
from argentor import Agent

async def main():
    agent = Agent(api_key="sk-ant-...")
    response = await agent.run_async("Explain quantum entanglement in one sentence.")
    print(response)

asyncio.run(main())

Session management

agent = Agent(api_key="sk-ant-...")
agent.run("My name is Federico.")
response = agent.run("What is my name?")  # maintains context
print(response)  # "Your name is Federico."

# Reset session
agent.reset_session()

Classes

Class Description
Agent Main agent class with run() / run_async()
Session Conversation history tracking
Message Single message (role + content)
Skill A callable tool the agent can invoke
SkillRegistry Registry for discovering and invoking skills

Rust extension (optional)

For the compiled Rust extension (PyO3/maturin, faster execution):

pip install maturin
cd crates/argentor-python
maturin develop

The crates/argentor-python/ extension exposes Session, SkillRegistry, GuardrailEngine, Calculator, HashTool, and JsonQuery as compiled Rust classes.

License

AGPL-3.0-only

Metadata

Release files for argentor 1.4.0

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

Source distribution (sdist)

Source distribution for argentor 1.4.0
File Size Uploaded Provenance Actions
argentor-1.4.0.tar.gz 8.8 kB Without provenance Details for argentor-1.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for argentor 1.4.0
File Interpreter ABI Platform Actions
argentor-1.4.0-py3-none-any.whl Python 3 none any Details for argentor-1.4.0-py3-none-any.whl

Total release size: 17.7 kB

Release files / argentor-1.4.0.tar.gz

Download URL argentor-1.4.0.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
57bd89adbd792df97da4a0208dae466298ca91e3db4da1318ad70794ed2a63a5
BLAKE2b-256 checksum
How to use checksums
5ca12db8bd28f3b4e6360f2a1ddd3be8c9e3a61e0cb98f2a7bdbfe35fcf606ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / argentor-1.4.0-py3-none-any.whl

Download URL argentor-1.4.0-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b78c624fd7e6446d3a832a796ce551a15d921cfc4e80bfa21a16fb49aeb22ae
BLAKE2b-256 checksum
How to use checksums
907187e8a1d5e6158f0fcd176e494ab2b66ce1d3b5fb3a63ef25a09adb3b5522
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Security for argentor 1.4.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.

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files No provenance

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