import Exa from "exa-js";
const exa = new Exa();
const run = await exa.agent.runs.create({
query: "Find wireless noise-cancelling headphones under $300 with pricing from multiple merchants.",
dataSources: [{ provider: "affiliate" }],
outputSchema: {
type: "object",
required: ["products"],
properties: {
products: {
type: "array",
maxItems: 10,
items: {
type: "object",
required: ["name", "brand", "price", "merchant"],
properties: {
name: { type: "string" },
brand: { type: "string" },
price: { type: "string", description: "price with currency" },
merchant: { type: "string" },
},
},
},
},
},
});