import Exa from "exa-js";
const exa = new Exa();
const run = await exa.agent.runs.create({
query: "Find the current Polymarket odds for major AI regulation proposals and summarize how the odds changed over the last month.",
dataSources: [{ provider: "polymarket" }],
outputSchema: {
type: "object",
required: ["markets"],
properties: {
markets: {
type: "array",
items: {
type: "object",
required: ["question", "odds", "trend"],
properties: {
question: { type: "string" },
odds: { type: "number" },
trend: { type: "string" },
},
},
},
},
},
});