Skip to main content

OmegaEngine governance integration for dspy-omega

Project description

OmegaEngine Logo

dspy-omega

DSPy Integration for OmegaEngine

PyPI License


✨ 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

pip install dspy-omega

🚀 Quick Start

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dspy_omega-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file dspy_omega-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dspy_omega-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for dspy_omega-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a062b7932330b0dc7e8749140ac8ceaa4398b09e9b3dc5706c091de1df5cdbf8
MD5 f1c2f244ffe24955b3f718065fe0f15a
BLAKE2b-256 73b0516b0d458ae56646414989858bfd963d04468c3cc3318c91a726c95f8172

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page