Skip to content
Agentmart
Submit a tool

openai-agents

Complete guide for integrating OpenAI Agents SDK with Temporal workflows, including setup, best practices, and error handling.

Skill by yasinnerten

IndexedApache-2.0
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/yasinnerten-openai-agents

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Complete guide for integrating OpenAI Agents SDK with Temporal workflows, including setup, best practices, and error handling.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/openai-agents

What's inside

Skill name
openai-agents
Description
Complete guide for integrating OpenAI Agents SDK with Temporal workflows, including setup, best practices, and error handling.
License
Apache-2.0
Metadata
category: ai-integration
Instructions
581 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • body: 581 lines (spec recommends under 500)

Files (1)

  • SKILL.md

SKILL.md (first lines)

# OpenAI Agents Integration

This skill provides comprehensive guidance for integrating OpenAI Agents SDK with Temporal workflow orchestration.

## Overview

OpenAI Agents SDK allows building autonomous AI systems that can use tools, make decisions, and execute complex tasks. When combined with Temporal, you get durable, reliable execution with built-in retries and observability.

## Setup and Configuration

### 1. Installation
```bash
# Install OpenAI SDK
pip install openai

# Install with Temporal
pip install temporalio

# Create requirements.txt
cat > requirements.txt << EOF
openai>=1.0.0
temporalio>=1.0.0
python-dotenv>=1.0.0
EOF

# Install dependencies
pip install -r requirements.txt
```

### 2. Environment Variables
```python
# .env file
OPENAI_API_KEY=sk-your-api-key-here
OPENAI_MODEL=gpt-4.7
OPENAI_MAX_TOKENS=4096
OPENAI_TEMPERATURE=0.7
TEMPORAL_HOST=localhost:7233
TEMPORAL_NAMESPACE=default
TEMPORAL_TASK_QUEUE=openai-queue
```

### 3. Initialization
```python
from openai import AsyncOpenAI
from dotenv import load_dotenv
import os

load_dotenv()

client = AsyncOpenAI(
    api_key=os.getenv("OPENAI_API_KEY"),
    organization=os.getenv("OPENAI_ORG_ID", None)
)

model = os.getenv("OPENAI_MODEL", "gpt-4")
```

## Basic Usage

### Chat Completions
```python
@activity.defn
async def chat_completion(prompt: str, system_message: str | None = None) -> str:
    """Generate text using OpenAI chat completion."""
    messages = []

    if system_message:
        messages.append({"role": "system", "content": system_message})

    messages.append({"role": "user", "content": prompt})

    response = await client.chat.completions.create(
        model="gpt-4",
        messages=messages,
        max_tokens=1000,
        temperature=0.7
    )

    return response.choices[0].message.content
```

### Streaming Responses
```python
@activity.defn
async def stream_completion(prompt: str) -> str:
    """Stream OpenAI responses for real-time feedback."""
    full_response = ""

    stream = await client.chat.completions.create(
        model="gpt-4",
        messages=[{"role": "user", "content": prompt}],
        stream=True
    )

    async for chunk in stream:
        if chunk.choices[0].delta.content:
            content = chunk.choices[0].delta.content
            full_response += content
            # Send progress update
            activity.heartbeat(f"Generated: {len(full_response)} chars")

    return full_response
```

## Agents with Tools

### 1. Function Calling
```python
from typing import TypedDict

class FunctionCall(TypedDict):
    name: str
    arguments: dict

functions = [
    {
        "type": "function",
        "function": {
            "name": "get_weather",

From yasinnerten/temporal-openai-agents-sdk, Apache-2.0.

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Feb 27, 2026 (8 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from yasinnerten

Cite this page

openai-agents skill. Agent Mart. https://agentmart.dev/skills/yasinnerten-openai-agents (last updated 2026-10-24)