Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 60 additions & 79 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,115 +1,96 @@
# Agent Assembly Python SDK

## Overview
Python SDK for AI Agent Assembly, providing a simple client for connecting agents to a governance gateway.

The Agent Assembly Python SDK provides a governance-native runtime for AI agents. This SDK enables developers to integrate AI agent lifecycle management, policy enforcement, and audit logging into their applications. It follows a WebAssembly-like pattern with a Rust core runtime and Python client interface.
## Requirements

- Python `>=3.12,<4.0`

## Python versions support
## Installation

This library requires Python 3.12+
From source:

[![Supported Versions](https://img.shields.io/pypi/pyversions/agent-assembly.svg?logo=python&logoColor=FBE072)](https://pypi.org/project/agent-assembly)


## Quickly Start

```python
from agent_assembly import init_assembly
```bash
pip install git+https://github.com/AI-agent-assembly/python-sdk.git
```

# Initialize the agent assembly
assembly = init_assembly(
gateway_url="https://gateway.agent-assembly.dev",
agent_id="my-agent-001"
)
For local development:

# Your agent is now ready with governance enabled
```bash
uv sync
```

## Documentation

🚧 The details of documentation ...
## Quick Start

## Reusable GitHub Actions Workflows & Actions
```python
import asyncio

This template provides a comprehensive set of **reusable GitHub Actions workflows and actions** that can be called from other repositories to standardize CI/CD operations. Projects using this template can leverage these centralized components for consistent automation.
from agent_assembly import init_assembly

### 🚀 Key Features

- **Centralized Management**: All workflows and actions are maintained in this template repository
- **Standardized Operations**: Consistent CI/CD processes across all projects
- **Easy Integration**: Simple calls using external repository references
- **Comprehensive Coverage**: Testing, building, releasing, Docker operations, documentation, and setup utilities
async def main() -> None:
client = init_assembly(
gateway_url="http://localhost:8080",
agent_id="my-agent-001",
api_key="optional-api-key",
)

### 📋 Available Workflows
try:
registration = await client.register_agent()
decision = await client.check_policy_compliance("tool.call")
print(registration)
print(decision)
finally:
client.close()

| Workflow | Purpose | Key Features |
|------------------------------------------------------|------------------------------|----------------------------------------|
| `rw_build_and_test.yaml` | Run comprehensive test suite | Unit, integration, e2e, contract tests |
| `rw_run_all_test_and_record.yaml` | Complete CI with reporting | CodeCov upload, SonarCloud analysis |
| `rw_python_package.yaml` | Python package operations | Build, test, publish to PyPI |
| `rw_docker_operations.yaml` | Docker operations | Build, test, push, security scanning |
| `rw_parse_release_intent.yaml` | Release configuration parser | Determines release components |
| `rw_build_git-tag_and_create_github-release_v2.yaml` | Git tagging and releases | Automated version management |
| `rw_docs_operations.yaml` | Documentation operations | Build, version, deploy docs |

### 📦 Available Actions
asyncio.run(main())
```

| Action | Purpose | Key Features |
|--------|---------|--------------|
| `setup-python-uv` | Python & UV setup with dependencies | Multi-version support, intelligent caching, flexible dependency groups |
## Public API

### 🔧 Quick Start
- `init_assembly(gateway_url, agent_id, api_key=None) -> GatewayClient`
- `GatewayClient.register_agent() -> dict`
- `GatewayClient.check_policy_compliance(action: str) -> dict`
- Exceptions: `AssemblyError`, `AgentError`, `PolicyError`, `GatewayError`, `ConfigurationError`
- Data models: `AgentConfig`, `AgentState`, `PolicyEvaluation`

To use these reusable workflows in your project, simply call them using external repository references:
## Error Handling

```yaml
# .github/workflows/ci.yaml in your project
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
```python
from agent_assembly import init_assembly
from agent_assembly.exceptions import ConfigurationError

jobs:
test:
uses: Chisanan232/Template-Python-UV-Project/.github/workflows/rw_run_all_test_and_record.yaml@master
secrets:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
sonar_token: ${{ secrets.SONAR_TOKEN }}
try:
client = init_assembly(gateway_url="", agent_id="my-agent-001")
except ConfigurationError as exc:
print(f"Invalid configuration: {exc}")
```

### 📚 Complete Documentation

- **[Reusable Workflows Guide](.github/workflows/REUSABLE_WORKFLOWS.md)**: Complete documentation with all inputs, outputs, and usage examples
- **[Example Workflows](.github/workflows/examples/)**: Ready-to-use example workflows for common scenarios
- **Template Placeholders**: All workflows use `<your_*>` placeholders for easy customization

### 💡 Benefits for Projects Using This Template

1. **Reduced Boilerplate**: No need to write complex CI/CD workflows from scratch
2. **Best Practices**: Workflows follow established patterns and security practices
3. **Automatic Updates**: Bug fixes and improvements are centrally maintained
4. **Consistency**: Same workflow behavior across all projects using the template
5. **Easy Maintenance**: Update workflows in one place, benefits all projects
## Development

Run tests:

## Coding style and following rules

**_<your lib name>_** follows coding styles **_black_** and **_PyLint_** to control code quality.
```bash
uv run pytest
```

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![linting: pylint](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/pylint-dev/pylint)
Run integration tests:

```bash
uv run pytest -m integration
```

## Downloading state
Lint and type-check:

🚧 The download state for your library
```bash
uv run ruff check .
uv run mypy agent_assembly
```

[![Downloads](https://pepy.tech/badge/<your lib name>)](https://pepy.tech/project/<your lib name>)
[![Downloads](https://pepy.tech/badge/<your lib name>/month)](https://pepy.tech/project/<your lib name>)
## Documentation

- Project docs source: `docs/`

## License

Expand Down
6 changes: 2 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# 📚 UV-Template Documentation
# 📚 Agent Assembly Python SDK Documentation

Welcome to the documentation site for UV-Template! This site is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
Welcome to the documentation site for the Agent Assembly Python SDK. This site is built using [Docusaurus](https://docusaurus.io/).

## 🗂️ Documentation Structure

The documentation is organized into the following sections:

- **📖 Docs** - Main user documentation and guides
- **👨‍💻 Development** - Technical documentation for developers
- **✍️ Blog** - Project updates and technical articles

## 🚀 Getting Started

Expand Down Expand Up @@ -57,7 +56,6 @@ pnpm serve --no-open
1. Add new Markdown files to:
- `contents/document/` for user documentation
- `contents/development/` for developer documentation
- `contents/blog/` for blog posts

2. Update the appropriate sidebar configuration:
- `contents/document/sidebars.ts` for docs
Expand Down
105 changes: 0 additions & 105 deletions docs/contents/blog/2025-09-01-project-origin.md

This file was deleted.

9 changes: 0 additions & 9 deletions docs/contents/blog/authors.yml

This file was deleted.

29 changes: 0 additions & 29 deletions docs/contents/blog/tags.yml

This file was deleted.

9 changes: 0 additions & 9 deletions docs/contents/development/architecture.mdx

This file was deleted.

Loading