async function multiPerspectiveAnalysis(topic: string) {
return withAgent("OrchestratorAgent", async () => {
const [technical, business, user] = await Promise.all([
withAgent("TechnicalAnalyst", async () =>
openai.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: `Technical analysis of: ${topic}` }],
})
),
withAgent("BusinessAnalyst", async () =>
openai.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: `Business analysis of: ${topic}` }],
})
),
withAgent("UserResearcher", async () =>
openai.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: `User perspective on: ${topic}` }],
})
),
]);
return { technical, business, user };
});
}