from exa_py import Exa
exa = Exa()
run = exa.agent.runs.create(
query="Find beach destinations reachable from New York for under $400 round-trip in March.",
data_sources=[{"provider": "jinko"}],
output_schema={
"type": "object",
"required": ["destinations"],
"properties": {
"destinations": {
"type": "array",
"maxItems": 10,
"items": {
"type": "object",
"required": ["city", "iataCode", "lowestFare"],
"properties": {
"city": {"type": "string"},
"iataCode": {"type": "string"},
"lowestFare": {"type": "number", "description": "round-trip fare in USD"},
},
},
}
},
},
)
run = exa.agent.runs.poll_until_finished(run.id)