OpenAI Agents SDK Integration for Agent Building

We design and deploy artificial intelligence systems: from prototype to production-ready solutions. Our team combines expertise in machine learning, data engineering and MLOps to make AI work not in the lab, but in real business.
Showing 1 of 1 servicesAll 1566 services
OpenAI Agents SDK Integration for Agent Building
Medium
from 1 week to 3 months
FAQ
AI Development Areas
AI Solution Development Stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_logo-advance_0.png
    B2B Advance company logo design
    561
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    823
  • image_logo-aider_0.jpg
    AIDER company logo development
    762
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    848

OpenAI Agents SDK Integration

OpenAI Agents SDK — official Python SDK for building agents based on OpenAI models. Provides abstractions over Assistants API and Responses API: Agent (wrapper over model with tools), Runner (agent execution), Handoffs (delegation between agents), Guardrails (checks), tracing. SDK replaces direct Assistants API calls with a more typed and testable interface.

Basic Agent

# pip install openai-agents
import asyncio
from openai import AsyncOpenAI
from agents import Agent, Runner, function_tool, RunConfig

client = AsyncOpenAI()

# Tools through decorator
@function_tool
def get_weather(city: str, unit: str = "celsius") -> str:
    """Get current weather in a city."""
    data = weather_api.get(city=city, unit=unit)
    return f"Weather in {city}: {data['temp']}°, {data['description']}"

# Create agent
assistant = Agent(
    name="Corporate Assistant",
    instructions="You are a corporate assistant. Help employees with meetings and tasks.",
    model="gpt-4o",
    tools=[get_weather],
)

# Run
async def main():
    result = await Runner.run(
        assistant,
        input="Schedule a team meeting for tomorrow at 2 PM",
    )
    print(result.final_output)

asyncio.run(main())

Handoffs: Delegation Between Specialized Agents

from agents import Agent, handoff, Runner

# Specialized agents for different domains
triage_agent = Agent(
    name="Triage",
    instructions="Classify request and delegate to appropriate agent.",
    model="gpt-4o-mini",
)

billing_agent = Agent(
    name="Billing Support",
    instructions="Help with billing questions, payments, subscriptions.",
    model="gpt-4o",
    tools=[get_invoice, process_refund, update_payment_method],
)

tech_agent = Agent(
    name="Technical Support",
    instructions="Solve technical issues: API, integrations, errors.",
    model="gpt-4o",
    tools=[check_api_status, get_error_logs, create_bug_report],
)

# Setup handoffs for triage
triage_agent.handoffs = [
    handoff(billing_agent, tool_name_override="transfer_to_billing"),
    handoff(tech_agent, tool_name_override="transfer_to_technical"),
]

# Triage automatically delegates to appropriate agent
result = await Runner.run(
    triage_agent,
    input="I was charged twice last month",
)

Timeline

  • Basic agent with tools: 2–4 days
  • Handoff architecture with 3–5 agents: 1–2 weeks
  • Guardrails and safety checks: 3–5 days
  • Tracing and monitoring: 3–5 days
  • Production deployment: 1 week