OpenAI Agents SDK
The OpenAI Agents SDK provider transforms Devcaster tools into the Agents SDK tool format with built-in execution.
Install
pip install devcaster devcaster-openai-agents openai-agentsnpm install @devcaster/core @devcaster/openai-agents @openai/agentsConfigure API Keys
Set DEVCASTER_API_KEY with your API key from Settings and OPENAI_API_KEY with your OpenAI API key.
DEVCASTER_API_KEY=xxxxxxxxx
OPENAI_API_KEY=xxxxxxxxxCreate session and run
import asyncio
from devcaster import Devcaster
from devcaster_openai_agents import OpenAIAgentsProvider
from agents import Agent, Runner
devcaster = Devcaster(provider=OpenAIAgentsProvider())
# Create a session for your user
session = devcaster.create(user_id="user_123")
tools = session.tools()
agent = Agent(
name="Email Agent",
instructions="You are a helpful assistant.",
tools=tools,
)
async def main():
result = await Runner.run(
starting_agent=agent,
input="Send an email to john@example.com with the subject 'Hello' and body 'Hello from Devcaster!'",
)
print(result.final_output)
asyncio.run(main())import { Devcaster } from "@devcaster/core";
import { OpenAIAgentsProvider } from "@devcaster/openai-agents";
import { Agent, run } from "@openai/agents";
const devcaster = new Devcaster({
provider: new OpenAIAgentsProvider(),
});
// Create a session for your user
const session = await devcaster.create("user_123");
const tools = await session.tools();
const agent = new Agent({
name: "Email Agent",
instructions: "You are a helpful assistant.",
tools,
});
const result = await run(
agent,
"Send an email to john@example.com with the subject 'Hello' and body 'Hello from Devcaster!'"
);
console.log(result.finalOutput);