from exa_py import Exa
exa = Exa()
run = exa.agent.runs.create(
query="I'm building a B2B sales prospecting list using a B2B company database. Find Series A fintech companies in New York with 50-200 employees, and for each return the company's LinkedIn profile, domain, employee count, and funding stage.",
data_sources=[{"provider": "fiber_ai"}],
output_schema={
"type": "object",
"required": ["companies"],
"properties": {
"companies": {
"type": "array",
"maxItems": 10,
"items": {
"type": "object",
"required": ["name", "domain", "employeeCount", "fundingStage"],
"properties": {
"name": {"type": "string"},
"domain": {"type": "string"},
"employeeCount": {"type": "number"},
"fundingStage": {"type": "string"},
},
},
}
},
},
)
run = exa.agent.runs.poll_until_finished(run.id)