Metadata-Version: 2.4
Name: autogen-omega
Version: 0.1.0
Summary: OmegaEngine governance integration for autogen-omega
Project-URL: Homepage, https://omegaengine.ai
Project-URL: Repository, https://github.com/TheArkhitect/Omegaengine
Author-email: OmegaEngine <team@omegaengine.ai>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: ai-safety,governance,llm,omegaengine
Requires-Python: >=3.8
Requires-Dist: httpx>=0.24.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Description-Content-Type: text/markdown

<p align="center">
  <img src="logo.png" alt="OmegaEngine Logo" width="200" height="200">
</p>

<h1 align="center">autogen-omega</h1>

<p align="center">
  <strong>Microsoft AutoGen Integration for OmegaEngine</strong>
</p>

<p align="center">
  <a href="https://pypi.org/project/autogen-omega/"><img src="https://img.shields.io/pypi/v/autogen-omega?color=blue&label=PyPI" alt="PyPI"></a>
  <a href="https://github.com/TheArkhitect/Omegaengine/actions"><img src="https://img.shields.io/github/actions/workflow/status/TheArkhitect/Omegaengine/ci.yml?branch=main" alt="CI"></a>
  <a href="https://github.com/TheArkhitect/Omegaengine/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue" alt="License"></a>
</p>

<p align="center">
  <a href="https://omegaengine.ai/docs">Documentation</a> •
  <a href="https://omegaengine.ai/playground">Playground</a> •
  <a href="https://github.com/TheArkhitect/Omegaengine/issues">Issues</a>
</p>

---

## ✨ Features

- 🤖 **Agent Wrapper** — Add governance to any AutoGen agent
- 🔄 **Conversation Guard** — Monitor multi-agent dialogues
- 🛡️ **Tool Execution Control** — Validate tool calls before execution
- 📊 **Group Chat Monitoring** — Oversee entire agent teams
- ⚡ **Human-in-the-Loop** — Automatic escalation on policy triggers

---

## 📦 Installation

```bash
pip install autogen-omega
```

---

## 🚀 Quick Start

### Governed Assistant Agent

```python
from autogen import AssistantAgent, UserProxyAgent
from autogen_omega import OmegaAssistantAgent

# Create a governed agent
assistant = OmegaAssistantAgent(
    name="analyst",
    system_message="You are a financial analyst.",
    omega_api_key="your-omega-api-key",
    policy_id="finance_policy",
    llm_config={"model": "gpt-4"}
)

user_proxy = UserProxyAgent(
    name="user",
    human_input_mode="NEVER",
)

# Start governed conversation
user_proxy.initiate_chat(
    assistant,
    message="Analyze this investment opportunity..."
)
```

### Group Chat with Governance

```python
from autogen import GroupChat, GroupChatManager
from autogen_omega import OmegaGroupChatManager

# Create your agents
researcher = OmegaAssistantAgent(name="researcher", ...)
analyst = OmegaAssistantAgent(name="analyst", ...)
writer = OmegaAssistantAgent(name="writer", ...)

# Governed group chat
group_chat = GroupChat(
    agents=[researcher, analyst, writer],
    messages=[],
)

manager = OmegaGroupChatManager(
    groupchat=group_chat,
    omega_api_key="your-omega-api-key",
    policy_id="team_policy",
)

# All agent interactions are monitored
user_proxy.initiate_chat(manager, message="Research and write a report...")
```

---

## 🛡️ Tool Execution Control

Validate tool/function calls before execution:

```python
from autogen_omega import OmegaToolValidator

validator = OmegaToolValidator(
    omega_api_key="your-omega-api-key",
    policy_id="tool_safety",
)

@validator.guard
def execute_sql(query: str) -> str:
    """Execute SQL query - governed by OmegaEngine"""
    return db.execute(query)

# SQL queries are validated before execution
# Dangerous queries like DROP TABLE are blocked
```

---

## 📊 Conversation Auditing

Every agent message is logged:

```python
from autogen_omega import OmegaConversationLogger

logger = OmegaConversationLogger(
    omega_api_key="your-omega-api-key",
    session_id="session_123",
)

# Attach to agents
assistant.register_hook("on_message", logger.log)

# Access full conversation audit
audit = logger.get_audit()
print(f"Messages: {audit.message_count}")
print(f"Policy violations: {audit.violations}")
```

---

## 🎯 Use Cases

| Use Case | How It Helps |
|----------|--------------|
| **Research Teams** | Ensure agents stay on topic |
| **Code Generation** | Prevent malicious code execution |
| **Document Processing** | Protect sensitive data |
| **Customer Service** | Enforce response policies |

---

## 📄 License

Licensed under the [Apache License 2.0](LICENSE).

---

<p align="center">
  Built with ❤️ by the <a href="https://omegaengine.ai">OmegaEngine</a> team
</p>
