openai-agents-sdklisted
Install: claude install-skill sheikh-mohammad/agent-factory-claude-skills
# OpenAI Agents SDK (Python)
## Overview
The OpenAI Agents SDK is a lightweight, Python-first package for building agentic AI apps with very few abstractions: **Agents** (LLMs with instructions and tools), **Agents as tools / Handoffs** (delegation), **Guardrails** (input/output validation), **Sessions** (memory across turns), and **Tracing** (observability). `Runner` executes agents with a built-in loop that manages turns, tool calls, handoffs, guardrails, and sessions.
Ground all code in the official docs. This skill's reference files reproduce the documented API — never invent imports or parameters.
## Core workflow (hello world)
```python
from agents import Agent, Runner
agent = Agent(name="Assistant", instructions="You are a helpful assistant")
result = Runner.run_sync(agent, "Write a haiku about recursion in programming.")
print(result.final_output)
```
Setup: `pip install openai-agents`, then set `OPENAI_API_KEY`. The SDK is async-first: use `await Runner.run(...)` inside an `async def main()` (or `asyncio.run(main())`); `Runner.run_sync()` for scripts.
## How to use this skill
1. Identify what the user is building (single agent → tools → multi-agent → production).
2. Read the matching reference file(s) below **before writing agent code**.
3. Use the example scripts in `assets/examples/` as starting points; adapt them to the user's needs.
4. For anything beyond these guides, consult the official docs (`https://openai.github.io/openai-agents-python/`); model I