import Exa from "exa-js";
const exa = new Exa();
const run = await exa.agent.runs.create({
query: "Find 10 fast-growing B2B SaaS companies and their estimated web traffic.",
dataSources: [{ provider: "similarweb" }],
outputSchema: {
type: "object",
required: ["companies"],
properties: {
companies: {
type: "array",
maxItems: 10,
items: {
type: "object",
required: ["name", "domain", "monthlyVisits"],
properties: {
name: { type: "string" },
domain: { type: "string" },
monthlyVisits: { type: "number", description: "from Similarweb" },
},
},
},
},
},
});