Skip to main content

dapr-agents-oas-adapter

Bidirectional conversion between Open Agent Spec (OAS) and Dapr Agents.

Python 3.12+ License CI

Overview

dapr-agents-oas-adapter enables seamless interoperability between Open Agent Spec (OAS) specifications and Dapr Agents. Import OAS specifications to create executable Dapr Agents and workflows, or export existing Dapr Agents to portable OAS format.

Key Features

  • Bidirectional conversion -- Import OAS specs into Dapr Agents and export back to OAS
  • Schema validation -- Validate OAS specifications before conversion with detailed error reports
  • Caching -- In-memory cache with configurable TTL for repeated operations
  • Async support -- Non-blocking loader for high-throughput applications
  • Structured logging -- Built-in structlog integration for observability

Installation

pip install dapr-agents-oas-adapter

Or with uv:

uv add dapr-agents-oas-adapter

Quick Start

Load an OAS spec and create a Dapr Agent

from dapr_agents_oas_adapter import DaprAgentSpecLoader

loader = DaprAgentSpecLoader()
config = loader.load_yaml(oas_yaml)
agent = loader.create_agent(config)

Export a Dapr Agent to OAS format

from dapr_agents_oas_adapter import DaprAgentSpecExporter

exporter = DaprAgentSpecExporter()
oas_dict = exporter.to_dict(config)

Validate before conversion

from dapr_agents_oas_adapter import StrictLoader

loader = StrictLoader()
try:
    config = loader.load_dict(oas_dict)
except OASSchemaValidationError as e:
    print(f"Validation failed: {e.issues}")

Component Mapping

OAS Component Dapr Agents
Agent AssistantAgent / ReActAgent
Flow @workflow decorated function
LlmNode @task with LLM call
ToolNode @task with tool call
FlowNode ctx.call_child_workflow()
MapNode Fan-out with wf.when_all()
ControlFlowEdge Branch routing via from_branch

Running the Examples

Prerequisites

  • Dapr CLI installed and initialized
  • An OpenAI API key in examples/_shared/dapr/components/secrets/

Run an example

cd examples/from_oas/04-agent-based-workflows
dapr run -f dapr.yaml -- python app.py

Examples are organized in two directions:

  • examples/from_oas/ -- Import OAS specs to create Dapr Agents
  • examples/to_oas/ -- Export Dapr Agents to OAS format

Development

git clone https://github.com/heltondoria/dapr-agents-oas-adapter.git
cd dapr-agents-oas-adapter
uv sync --all-groups
uv run pytest                          # Run tests
uv run ruff check .                    # Lint
uv run ruff format --check .           # Check formatting
uv run ty check                        # Type check
uv run codespell .                     # Spell check
uv run vulture .                       # Dead code detection

Tests require 90% coverage:

uv run pytest --cov=src/dapr_agents_oas_adapter --cov-fail-under=90

Documentation

Full documentation is available at heltondoria.github.io/dapr-agents-oas-adapter.

To serve locally:

uv run mkdocs serve

License

Apache License 2.0 -- see LICENSE for details.

Metadata

Release files for dapr-agents-oas-adapter 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dapr-agents-oas-adapter 0.8.0
File Size Uploaded
dapr_agents_oas_adapter-0.8.0.tar.gz 54.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dapr-agents-oas-adapter 0.8.0
File Interpreter ABI Platform
dapr_agents_oas_adapter-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 120.3 kB

Release files / dapr_agents_oas_adapter-0.8.0.tar.gz

Download URL dapr_agents_oas_adapter-0.8.0.tar.gz
Size 54.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6cfc61433272587a5cf45ed5677bfc6d97a18c6e424c7a77319927a207ea9b76
BLAKE2b-256 checksum
How to use checksums
176bdc121bdbd7f1bb9f1d5a3458898915b01ac0daa72427f045145755b69707
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 19, 2026.

Transparency log

Release files / dapr_agents_oas_adapter-0.8.0-py3-none-any.whl

Download URL dapr_agents_oas_adapter-0.8.0-py3-none-any.whl
Size 65.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b1160f5dda430a51fa4d9533efc9fc73615c0e7c9bc137d961cb4575c8d79f23
BLAKE2b-256 checksum
How to use checksums
b5fcfcb4f8efa317495e113fdf772b9755279124345ce7c93920265fc6a23e5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page