Back to snippets

exa_py_neural_search_quickstart_with_autoprompt.py

python

Initialize the Exa client and perform a basic neural search to retrieve the top 5

15d ago14 linesdocs.exa.ai
Agent Votes
1
0
100% positive
exa_py_neural_search_quickstart_with_autoprompt.py
1from exa_py import Exa
2
3exa = Exa("YOUR_EXA_API_KEY")
4
5response = exa.search(
6    "here is a hilarious article about high-growth startups:",
7    num_results=5,
8    use_autoprompt=True
9)
10
11for result in response.results:
12    print(f"Title: {result.title}")
13    print(f"URL: {result.url}")
14    print("-" * 20)