Metadata-Version: 2.5
Name: aice-agent-platform
Version: 0.2.1
Summary: Python SDK for the AICE Agent Platform (config-driven LangGraph agent runtime)
Author-email: Adanian Labs <engineering@adanianlabs.io>
License: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: aice-core<0.4,>=0.3.0
Requires-Dist: langgraph-sdk<0.2,>=0.1.60
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8.3; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Description-Content-Type: text/markdown

# aice-agent-platform

Python SDK for the [Agent Platform](../../../aice_packages/agent_platform/) the
config-driven LangGraph agent runtime exposed over Aegra's Agent Protocol.

This SDK is a composition of two surfaces:

1. **AICE-specific management routes** (`agents`, `skills`, `usage`,
   `suggestions`) go through `aice-core`'s shared transport, so they get
   the usual typed `AiceError` hierarchy, retries, and idempotency-key
   handling.
2. **The native LangGraph surface** (`threads`, `runs`, `assistants`,
   `crons`) this service is a LangGraph Platform-compatible deployment,
   so this SDK composes the official
   [`langgraph-sdk`](https://reference.langchain.com/python/langgraph-sdk)
   directly rather than re-implementing it. This is where streaming/run
   execution lives.

**These two surfaces do not share error types or retry behavior.**
`client.threads`/`client.runs`/`client.assistants`/`client.crons` raise
whatever `langgraph-sdk` itself raises, with its own retry policy never
`aice_core.AiceError`. `client.agents`/`client.skills`/`client.usage`/
`client.suggestions` behave like every other AICE SDK. See the docstring at
the top of `client.py` for the full rationale.

```python
from aice_agent_platform import AgentPlatformClient

client = AgentPlatformClient(base_url="https://agents.example.com", api_key="sk-…")

# ── AICE-specific management routes ────────────────────────────────────

# List available agents
agents = client.agents.list()

# Publish a saved agent definition so it's runnable
client.agents.publish("ag_123")

# Discover skills
skills = client.skills.list()

# Fetch usage counters for the current project
usage = client.usage.get()

# Trigger the post-turn suggestion engine for a thread
suggestions = client.suggestions.create_for_thread("th_123")

# ── Native LangGraph surface (streaming, threads, runs) ────────────────

thread = client.threads.create()

for chunk in client.runs.stream(
    thread["thread_id"],
    assistant_id="agent",
    input={"messages": [{"role": "user", "content": "hi"}]},
):
    print(chunk.event, chunk.data)
```

Async variant mirrors this with `AsyncAgentPlatformClient` and `await`/
`async for`.

See the upstream service's own
[docs/API.md](../../../aice_packages/agent_platform/docs/API.md) for the
AICE-specific endpoint spec this SDK tracks, and the
[LangGraph SDK reference](https://reference.langchain.com/python/langgraph-sdk)
for the native `threads`/`runs`/`assistants`/`crons` surface.
