from exa_py import Exa
exa = Exa()
run = exa.agent.runs.create(
query="Get recent news about NVIDIA (NVDA) and summarize the key themes.",
data_sources=[{"provider": "financial_datasets"}],
output_schema={
"type": "object",
"required": ["ticker", "articles"],
"properties": {
"ticker": {"type": "string"},
"articles": {
"type": "array",
"maxItems": 10,
"items": {
"type": "object",
"required": ["title", "source", "date", "theme"],
"properties": {
"title": {"type": "string"},
"source": {"type": "string"},
"date": {"type": "string"},
"theme": {"type": "string", "description": "e.g. earnings, product launch, regulation"},
},
},
},
},
},
)
run = exa.agent.runs.poll_until_finished(run.id)