You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow developers to use the OpenAI Agents SDK with Exosphere as the underlying reliability and orchestration platform.
# Goal: familiar OpenAI patterns, Exosphere reliabilityfromexospherehost.openaiimportagentsagent=agents.Agent(
name="research-assistant",
instructions="You help with research tasks",
tools=[web_search, file_reader]
)
# Runs on Exosphere with retries, state persistence, observabilityresult=awaitagents.run(agent, "Find recent papers on LLM agents")
# Standard OpenAI Agents SDK usagefromagentsimportAgent, Runneragent=Agent(
name="assistant",
instructions="You are helpful",
tools=[my_tool]
)
result=Runner.run_sync(agent, "Hello")
Proposed Integration
Approach: Wrap OpenAI SDK, Execute on Exosphere
flowchart TB
subgraph "Developer Code"
DEV[from exospherehost.openai import agents]
end
subgraph "exospherehost.openai"
WRAP[Thin wrapper over OpenAI SDK]
end
subgraph "Exosphere Runtime"
NODE[AgentNode executes agent]
SM[State Manager tracks progress]
end
DEV --> WRAP
WRAP --> NODE
NODE --> SM
Loading
Key Design Decisions
Minimal wrapper: Don't reimplement OpenAI SDK, wrap it
Transparent to developers: Same API they already know
Opt-in reliability: Easy to add retries, persistence
Graph integration: Agents as nodes in larger workflows
Prototype Scope
In Scope
exospherehost.openai.agents module
Wrap Agent and Runner classes
Execute agent runs as Exosphere states
Basic retry support
Execution tracking in dashboard
Out of Scope (Future)
Multi-agent handoffs as graph edges
Streaming responses through Exosphere
Custom tool execution as separate nodes
Guardrails integration
API Design (Draft)
Simple Usage
fromexospherehost.openaiimportagents# Define agent (same as OpenAI SDK)assistant=agents.Agent(
name="assistant",
instructions="You help users with questions",
model="gpt-4o"
)
# Run with Exosphere reliabilityresult=awaitagents.run(
assistant,
"What is the capital of France?",
retry_policy={"max_retries": 3, "strategy": "EXPONENTIAL"}
)
print(result.output)
As Part of a Graph
fromexospherehostimportBaseNodefromexospherehost.openaiimportagentsclassResearchAgent(BaseNode):
classInputs(BaseModel):
query: strclassOutputs(BaseModel):
findings: strasyncdefexecute(self, inputs):
agent=agents.Agent(
name="researcher",
instructions="Find information on the given topic",
tools=[web_search]
)
result=awaitagents.run(agent, inputs.query)
returnself.Outputs(findings=result.output)
# exospherehost/openai/agents.pyfromopenai_agentsimportAgentasOpenAIAgent, RunnerfromexospherehostimportStateManager# Re-export Agent class unchangedAgent=OpenAIAgentasyncdefrun(agent: Agent, message: str, retry_policy: dict=None):
""" Execute an OpenAI agent with Exosphere reliability. - Tracks execution as a state - Applies retry policy on failure - Records output for observability """# For prototype: direct execution with retry wrapper# Future: create state in State Manager, execute via Runtimemax_retries=retry_policy.get("max_retries", 0) ifretry_policyelse0forattemptinrange(max_retries+1):
try:
result=awaitRunner.run(agent, message)
returnresultexceptExceptionase:
ifattempt==max_retries:
raise# Apply backoff strategyawaitasyncio.sleep(2**attempt)
Open Questions
How deep should integration go?
Shallow: Just wrap run() with retries
Deep: Each tool call is a separate Exosphere state
Allow developers to use the OpenAI Agents SDK with Exosphere as the underlying reliability and orchestration platform.
Why This Matters
OpenAI Agents SDK Overview
The OpenAI Agents SDK provides:
Proposed Integration
Approach: Wrap OpenAI SDK, Execute on Exosphere
flowchart TB subgraph "Developer Code" DEV[from exospherehost.openai import agents] end subgraph "exospherehost.openai" WRAP[Thin wrapper over OpenAI SDK] end subgraph "Exosphere Runtime" NODE[AgentNode executes agent] SM[State Manager tracks progress] end DEV --> WRAP WRAP --> NODE NODE --> SMKey Design Decisions
Prototype Scope
In Scope
exospherehost.openai.agentsmoduleAgentandRunnerclassesOut of Scope (Future)
API Design (Draft)
Simple Usage
As Part of a Graph
Implementation Sketch
Module Structure
Core Wrapper
Open Questions
How deep should integration go?
run()with retriesHow to handle streaming?
Multi-agent handoffs?
Dependency management?
openai-agentsan optional dependencypip install exospherehost[openai]Effort Estimate
run()wrapper with retriesTotal: 5-7 days for prototype
Success Criteria
from exospherehost.openai import agentsReferences
python-sdk/exospherehost/__init__.py