Skip to main content

astro-agents

astro-agents is a Python client library for the Astro Agents platform — a managed runtime for building, running, and observing LLM agent workloads. It provides typed clients for the Astro control plane and runtime so you can register agent definitions, stream inference and tool-call events, attach to live sessions, and ship traces to the Astro observability backend. It is aimed at teams deploying agent pipelines that need durable execution, multi-step tool calling, and per-session telemetry.

The SDK is published from the python/ subdirectory of the astro-agents-clients monorepo and works with both hosted Astro tenants and self-hosted runtimes.

Features

  • Typed async client for the Astro control plane (AgentClient) with agents, sessions, runs, and trace endpoints.
  • Stream agent responses token-by-token via runs.stream() and consume structured tool-call events (ToolCall, ToolResult).
  • Register agent definitions (model, tools, system prompt) and pin them to a named version for reproducible runs.
  • Attach middleware for guardrails, redaction, and retries before each model call.
  • Export OpenTelemetry-compatible traces from every run to the Astro observability backend.
  • Replay a finished run locally from its trace ID for debugging.
  • Sync helpers (to_dict, to_pandas) for exporting run history to notebooks.

Installation

pip install "astro-agents @ git+https://github.com/aidatatools-dev/astro-agents-clients#subdirectory=python"

Quick start

from astro_agents import AgentClient

client = AgentClient(api_key="astro_live_...")

agent = client.agents.create(
    name="support-triage",
    model="astro/gpt-4o-mini",
    tools=[{"type": "function", "function": {"name": "lookup_order"}}],
    system_prompt="Triage incoming support tickets and route by urgency.",
)

run = client.runs.start(
    agent_id=agent.id,
    input="Order #8842 was charged twice — please escalate.",
)

for event in client.runs.stream(run.id):
    if event.type == "tool_call":
        print("calling", event.tool, event.args)
    elif event.type == "text":
        print(event.delta, end="")

API

  • AgentClient(api_key: str, *, base_url: str | None = None) — entry point; exposes .agents, .runs, .sessions, and .traces namespaces.
  • AgentClient.agents.create(name, model, tools, system_prompt) -> Agent — registers a versioned agent definition.
  • AgentClient.runs.start(agent_id, input, **kwargs) -> Run — starts a run; pass session_id to continue a conversation.
  • AgentClient.runs.stream(run_id) -> AsyncIterator[AgentEvent] — yields text, tool_call, tool_result, and finish events.

Configuration

  • ASTRO_API_KEY — default API key when AgentClient is constructed without arguments.
  • ASTRO_BASE_URL — override the control-plane endpoint (default https://api.astro-agent.dev).
  • ASTRO_TRACE_EXPORT — set to otlp, stdout, or off to control trace export from runs.

License

MIT

Metadata

Release files for astro-agents 0.1.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 astro-agents 0.1.0
File Size Uploaded Provenance Actions
astro_agents-0.1.0.tar.gz 6.1 kB Without provenance Details for astro_agents-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for astro-agents 0.1.0
File Interpreter ABI Platform Actions
astro_agents-0.1.0-py3-none-any.whl Python 3 none any Details for astro_agents-0.1.0-py3-none-any.whl

Total release size: 12.9 kB

Release files / astro_agents-0.1.0.tar.gz

Download URL astro_agents-0.1.0.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d21eb2efb4d578a0958da8af708e9971d00fe2becfabd2711ca6e7f7f98a66d2
BLAKE2b-256 checksum
How to use checksums
389491c3172b1599d4cb6a4a9178ea6c0b664222b3193a98e34b47ac822c3aa3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / astro_agents-0.1.0-py3-none-any.whl

Download URL astro_agents-0.1.0-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8239370fac4a88ed316920eaa2f7a55a6dd4f59703c6d07f61be239791f0328
BLAKE2b-256 checksum
How to use checksums
235c2a73913201ba5d1cfb633d312fa2ecfbf46a7c84edf7a6e7c4121d2bea39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for astro-agents 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.

Release history Release notifications | RSS feed

This release

0.1.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