Temporal
Prerequisites
Installation
pip install temporalio openai openai-agents interactiveai openinference-instrumentation-openai-agentsConfiguration
import os
# InteractiveAI credentials
# Obtain keys from Settings > API Keys in the dashboard
os.environ["INTERACTIVEAI_PUBLIC_KEY"] = "pk-ia-..."
os.environ["INTERACTIVEAI_SECRET_KEY"] = "sk-ia-..."
os.environ["INTERACTIVEAI_HOST"] = "https://app.interactiveai.com"
# OpenAI credentials
os.environ["OPENAI_API_KEY"] = "sk-proj-..."
# Temporal server configuration
os.environ["TEMPORAL_HOST"] = "localhost:7233"
os.environ.setdefault("TEMPORAL_NAMESPACE", "default")
os.environ.setdefault("TEMPORAL_TASK_QUEUE", "agents-task-queue")Enabling Trace Capture
Example: Building a Research Pipeline
Step 1: Define Data Models
Step 2: Create Agent Factories
Step 3: Build the Research Manager
Step 4: Define the Temporal Workflow
Step 5: Execute the Workflow
Trace Visibility
Last updated
Was this helpful?

