Metadata-Version: 2.4
Name: dspy-omega
Version: 0.1.0
Summary: OmegaEngine governance integration for dspy-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">dspy-omega</h1>

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

<p align="center">
  <a href="https://pypi.org/project/dspy-omega/"><img src="https://img.shields.io/pypi/v/dspy-omega?color=blue&label=PyPI" alt="PyPI"></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>

---

## ✨ Features

- 🧠 **Programmatic Prompting** — Govern DSPy modules
- 📊 **Signature Validation** — Validate input/output signatures
- 🔄 **Optimizer Governance** — Control optimization runs
- 📈 **Trace Logging** — Full audit of DSPy pipelines
- 🛡️ **Module Wrappers** — Governance for any DSPy module

---

## 📦 Installation

```bash
pip install dspy-omega
```

---

## 🚀 Quick Start

```python
import dspy
from dspy_omega import OmegaModule, configure_omega

# Configure governance
configure_omega(
    api_key="your-omega-key",
    policy_id="dspy_policy",
)

class RAG(dspy.Module):
    def __init__(self):
        self.retrieve = dspy.Retrieve(k=3)
        self.generate = dspy.ChainOfThought("context, question -> answer")

    def forward(self, question):
        context = self.retrieve(question).passages
        return self.generate(context=context, question=question)

# Wrap with governance
governed_rag = OmegaModule(RAG())

# All module calls are governed
result = governed_rag(question="What is AI safety?")
print(result.answer)
print(result.omega_audit_id)
```

---

## 🔄 Optimizer Governance

```python
from dspy_omega import governed_optimizer

# Control optimization runs
optimizer = governed_optimizer(
    dspy.MIPROv2(),
    omega_api_key="...",
    max_unsafe_retries=3,
)
```

---

## 📄 License

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