Metadata-Version: 2.4
Name: aceteam-aep
Version: 0.1.0
Summary: AEP-native execution layer for AI agents - spans, costs, budget enforcement
Project-URL: Homepage, https://aceteam.ai
Project-URL: Repository, https://github.com/aceteam-ai/aceteam-aep
Author-email: AceTeam AI <contact@aceteam.ai>
License-Expression: Apache-2.0
Keywords: aep,agents,ai,cost-tracking,llm
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.12
Requires-Dist: anthropic<1.0.0,>=0.45.0
Requires-Dist: google-genai<2.0.0,>=1.0.0
Requires-Dist: httpx>=0.28.0
Requires-Dist: openai<2.0.0,>=1.65.0
Requires-Dist: pydantic>=2.11.0
Provides-Extra: all
Requires-Dist: ollama<1.0.0,>=0.4.0; extra == 'all'
Requires-Dist: openai<2.0.0,>=1.65.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: ollama<1.0.0,>=0.4.0; extra == 'dev'
Requires-Dist: openai<2.0.0,>=1.65.0; extra == 'dev'
Requires-Dist: pyright>=1.1; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.11; extra == 'dev'
Provides-Extra: ollama
Requires-Dist: ollama<1.0.0,>=0.4.0; extra == 'ollama'
Provides-Extra: xai
Requires-Dist: openai<2.0.0,>=1.65.0; extra == 'xai'
Description-Content-Type: text/markdown

# aceteam-aep

AEP-native execution layer for AI agents. Replaces LangChain with direct provider SDKs while adding AEP protocol compliance (spans, costs, budget enforcement).

## Installation

```bash
pip install aceteam-aep
# Or with all providers:
pip install aceteam-aep[all]
```

## Quick Start

```python
from aceteam_aep import create_client, run_agent_loop, ChatMessage, tool

# Create a client
client = create_client("gpt-4o", api_key="sk-...")

# Define tools
@tool
def calculator(expression: str) -> str:
    """Evaluate a math expression."""
    return str(eval(expression))

# Run agent loop
result = await run_agent_loop(
    client,
    [ChatMessage(role="user", content="What is 2+2?")],
    tools=[calculator],
    system_prompt="You are a helpful assistant.",
)
```

## AEP Compliance

Every execution through `run_agent_loop` can produce AEP-compliant output:

```python
from aceteam_aep import SpanTracker, CostTracker, BudgetEnforcer

tracker = SpanTracker()
costs = CostTracker(entity="org:my-org")
budget = BudgetEnforcer(total="10.00")

result = await run_agent_loop(
    client, messages,
    span_tracker=tracker,
    cost_tracker=costs,
    budget=budget,
)

# Access AEP data
print(tracker.get_spans())      # Execution trace
print(costs.get_cost_tree())    # Hierarchical costs
print(budget.state.remaining()) # Budget remaining
```

## Streaming

```python
from aceteam_aep import run_agent_loop_stream

async for event in run_agent_loop_stream(client, messages, tools=tools):
    if event.type == "chunk":
        print(event.data["text"], end="")
    elif event.type == "tool_call_start":
        print(f"\nCalling {event.data['name']}...")
    elif event.type == "cost":
        print(f"\nCost: ${event.data['compute_cost']}")
```

## Providers

- **OpenAI** (GPT-4o, o1, o3, etc.)
- **Anthropic** (Claude Opus, Sonnet, Haiku)
- **Google** (Gemini 2.5, 3.0)
- **xAI** (Grok)
- **Ollama** (local models)
- **OpenAI-compatible** (SambaNova, TheAgentic, DeepSeek)
