ZenML
OpenAI Agents SDK
All integrations

OpenAI Agents SDK

OpenAI Agents SDK integrated with ZenML

Add to ZenML

OpenAI Agents SDK integrated with ZenML

The OpenAI Agents SDK lets you build structured agents that use GPT models with function tools and tracing. Integrating it with ZenML wraps those agents inside reproducible pipelines with artifact tracking, observability, and deployment flexibility, so your prototypes scale into production-ready systems.

Features with ZenML

  • Structured agent orchestration. Run OpenAI Agents SDK agents as reproducible ZenML pipeline steps.
  • Artifact tracking. Capture prompts, tool calls, and agent responses as ZenML artifacts for full lineage.
  • Built-in monitoring. Combine SDK’s tracing with ZenML’s observability features.
  • Composable workflows. Integrate OpenAI agents with evals, retrieval, or deployment steps in one pipeline.
  • Scalable deployment. Move seamlessly from local tests to production orchestrators like Kubernetes or Airflow.
OpenAI Agents SDK integration screenshot

Main Features

  • Structured agent execution. Define GPT-powered agents with structured inputs/outputs.
  • Function tools. Extend agent capabilities with the @function_tool decorator.
  • Tracing built-in. Get detailed monitoring of tool usage and model calls.

How to use ZenML with OpenAI Agents SDK

from zenml import ExternalArtifact, pipeline, step
from openai_agent import agent
import agents

@step
def run_openai(query: str) -> str:
   runner = agents.run.DEFAULT_AGENT_RUNNER
   result = runner.run_sync(agent, query)
   return str(result.final_output)

@pipeline
def openai_agent_pipeline() -> str:
   q = ExternalArtifact(value="Tell me a fun fact about Tokyo")
   return run_openai(q.value)

if __name__ == "__main__":
   print(openai_agent_pipeline())

Additional Resources

Connect Your ML Pipelines to a World of Tools

Expand your ML pipelines with more than 50 ZenML Integrations

  • Amazon S3
  • Apache Airflow
  • Argilla
  • AutoGen
  • AWS
  • AWS Strands
  • Azure Blob Storage
  • Azure Container Registry
  • AzureML Pipelines
  • BentoML
  • Comet