🎯

examples-auto-run

🎯Skill

from openai/openai-agents-python

VibeIndex|
What it does

Automatically executes and validates example code snippets from the OpenAI Agents SDK repository to ensure they run correctly and demonstrate proper usage.

examples-auto-run

Installation

Install skill:
npx skills add https://github.com/openai/openai-agents-python --skill examples-auto-run
15
Last UpdatedJan 23, 2026

Skill Details

SKILL.md

Overview

# OpenAI Agents SDK [![PyPI](https://img.shields.io/pypi/v/openai-agents?label=pypi%20package)](https://pypi.org/project/openai-agents/)

The OpenAI Agents SDK is a lightweight yet powerful framework for building multi-agent workflows. It is provider-agnostic, supporting the OpenAI Responses and Chat Completions APIs, as well as 100+ other LLMs.

Image of the Agents Tracing UI

> [!NOTE]

> Looking for the JavaScript/TypeScript version? Check out [Agents SDK JS/TS](https://github.com/openai/openai-agents-js).

Core concepts:

  1. [Agents](https://openai.github.io/openai-agents-python/agents): LLMs configured with instructions, tools, guardrails, and handoffs
  2. [Handoffs](https://openai.github.io/openai-agents-python/handoffs/): A specialized tool call used by the Agents SDK for transferring control between agents
  3. [Guardrails](https://openai.github.io/openai-agents-python/guardrails/): Configurable safety checks for input and output validation
  4. [Sessions](#sessions): Automatic conversation history management across agent runs
  5. [Tracing](https://openai.github.io/openai-agents-python/tracing/): Built-in tracking of agent runs, allowing you to view, debug and optimize your workflows

Explore the [examples](examples) directory to see the SDK in action, and read our [documentation](https://openai.github.io/openai-agents-python/) for more details.

Get started

To get started, set up your Python environment (Python 3.9 or newer required), and then install OpenAI Agents SDK package.

venv

```bash

python -m venv .venv

source .venv/bin/activate # On Windows: .venv\Scripts\activate

pip install openai-agents

```

For voice support, install with the optional voice group: pip install 'openai-agents[voice]'.

For Redis session support, install with the optional redis group: pip install 'openai-agents[redis]'.

uv

If you're familiar with [uv](https://docs.astral.sh/uv/), installing the package would be even easier:

```bash

uv init

uv add openai-agents

```

For voice support, install with the optional voice group: uv add 'openai-agents[voice]'.

For Redis session support, install with the optional redis group: uv add 'openai-agents[redis]'.

Hello world example

```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)

# Code within the code,

# Functions calling themselves,

# Infinite loop's dance.

```

(_If running this, ensure you set the OPENAI_API_KEY environment variable_)

(_For Jupyter notebook users, see [hello_world_jupyter.ipynb](examples/basic/hello_world_jupyter.ipynb)_)

Handoffs example

```python

from agents import Agent, Runner

import asyncio

spanish_agent = Agent(

name="Spanish agent",

instructions="You only speak Spanish.",

)

english_agent = Agent(

name="English agent",

instructions="You only speak English",

)

triage_agent = Agent(

name="Triage agent",

instructions="Handoff to the appropriate agent based on the language of the request.",

handoffs=[spanish_agent, english_agent],

)

async def main():

result = await Runner.run(triage_agent, input="Hola, ¿cómo estás?")

print(result.final_output)

# ¡Hola! Estoy bien, gracias por preguntar. ¿Y tú, cómo estás?

if __name__ == "__main__":

asyncio.run(main())

```

Functions example

```python

import asyncio

from agents import Agent, Runner, function_tool

@function_tool

def get_weather(city: str) -> str:

return f"The weather in {city} is sunny."

agent = Agent(

name="Hello world",

instructions="You are a helpful agent.",

tools=[get_weather],

)

async def main():

result = await Runner.run(agent, input="What's the weather in Tokyo?")

print(result.final_output)

# The w