import { Agent, MemorySession } from "@openai/agents";
import { OpenAIAgentsAdapter } from "pandaprobe/integrations/openai-agents";
import { Client } from "pandaprobe";
import { Reflect as ReflectRuntime } from "pandaprobe/reflect";
async function main() {
const client = new Client();
const reflect = new ReflectRuntime(client);
try {
await new OpenAIAgentsAdapter({ client }).instrument();
const agent = await reflect.agent(Agent, {
framework: "openai-agents",
options: {
name: "Support", model: "gpt-6-luna",
instructions: "For standard returns, refund merchandise paid and exclude outbound shipping. Explain the policy clearly.",
tools: [], // Your native function tools go here.
},
invokeOptions: { session: new MemorySession({ sessionId: "customer-42" }) },
});
const result = await reflect.run(agent, "I paid $65 for an item and $7 for shipping. What is refundable?", { sessionId: "customer-42" });
console.log(result.finalOutput);
} finally {
await reflect.close();
await client.shutdown();
}
}
main().catch(error => { console.error(error); process.exitCode = 1; });