ariacompute-agent
The Aria agent SDK for Python. It exposes an Agent-based API
(Agent, Runner.run, Runner.run_streamed, function_tool, Session) and
talks to an aria-agent-cloud deployment through its beta Agents REST API.
pip install ariacompute-agent
import asyncio
from ariacompute_agent import Agent, Runner
async def main() -> None:
agent = Agent(
name="History tutor",
instructions="Answer history questions clearly and concisely.",
model="gpt-4o-mini",
)
result = await Runner.run(agent, "When did the Roman Empire fall?")
print(result.final_output)
asyncio.run(main())
Tools
from ariacompute_agent import function_tool
@function_tool
def history_fun_fact() -> str:
"""Return a short history fact."""
return "Sharks are older than trees."
agent = Agent(name="History tutor", tools=[history_fun_fact])
The cloud executes tools inside its own sandbox, so only the schema
(name / description / parameters) is sent to the server.
Streaming
streamed = await Runner.run_streamed(agent, "Tell me something surprising")
async for ev in streamed.events:
if ev["type"] == "agent.turn.output_text.delta":
print(ev["delta"], end="")
result = await streamed.completed
print(result.final_output)
Frames use the agent.* envelope, including agent.turn.approval.requested /
agent.turn.approval.resolved and agent.turn.usage. A completed result carries
result.usage (TokenUsage: input / output / total tokens and model) when the
server reports it. agent.turn.completed (or agent.turn.failed) is the
only terminal event — there is no data: [DONE] sentinel.
A stream that ends without a single agent.* frame raises AriaError with
AriaErrorKind.UNKNOWN instead of returning an empty answer; max_turns must be
a positive integer and caps a runaway stream with AriaErrorKind.CONFIG.
Memory
Keyed long-term memory lives in cloud (session REST), local (aria memo
SQLite, rows stored as key: value, readable with aria-memo list --json) or
both (write both, read with the cloud copy winning). Configure it on the agent
(memory_backend=, memo_db=) and override per call:
session.memorize("user_name", "Ada") # default backend
session.recall("user_name", backend="local") # local copy only
An unknown backend raises AriaError with AriaErrorKind.CONFIG.
Sessions
session = Session.create(agent)
await Runner.run(agent, "hello", session=session)
await Runner.run(agent, "and then?", session=session)
title = session.get_title() # SessionTitle(session_id, title, source, updated_at)
items = session.get_items()
turns = session.get_turns()
get_title() reads the projected session title; before the first turn it raises
a 404. A delegated child session (<parent>::sub::<id>) is readable through the
same method as long as the caller owns the parent.
Configuration
| Option | Environment variable | Default |
|---|---|---|
base_url |
ARIA_AGENT_BASE_URL |
http://localhost:3000 |
api_key |
ARIA_AGENT_API_KEY |
(none) |
beta_header |
– | agents=v1 (OpenAI-Beta) |
Tests
python3 -m unittest discover -s tests
Metadata
Release files for ariacompute-agent 1.12.1
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 |
|---|---|---|---|---|
| ariacompute_agent-1.12.1.tar.gz | 19.1 kB | Without provenance | Details for ariacompute_agent-1.12.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ariacompute_agent-1.12.1-py3-none-any.whl | Python 3 | none | any | Details for ariacompute_agent-1.12.1-py3-none-any.whl |
Total release size: 36.0 kB
Release files / ariacompute_agent-1.12.1.tar.gz
| Download URL | ariacompute_agent-1.12.1.tar.gz |
|---|---|
| Size | 19.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4b20b283f5ad11eafe213809caa3e372fd913e0db04d9dc53cbd800b50f4f197
|
|
BLAKE2b-256 checksum How to use checksums |
5e5a3a59f15afd8f36ae4cb4d804380502d0002756d6bfe8d0136d6f5eea4502
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.16
|
Release files / ariacompute_agent-1.12.1-py3-none-any.whl
| Download URL | ariacompute_agent-1.12.1-py3-none-any.whl |
|---|---|
| Size | 16.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a912c3d82e4810aec527bbf4ff633daf8e3a8575ea35c9705e2793d72f07004b
|
|
BLAKE2b-256 checksum How to use checksums |
012caa60918c61a873d32c4f4055b927c5acb375a5efbc84bbc715c443a65665
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.16
|
Security for ariacompute-agent 1.12.1
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.