What’s In a Name: A Simple Web App Using Perplexity’s Sonar API
Whats In A Name is a simple Flask app that uses the Sonar API from Perplexity.ai to fetch interesting, cultural, and historical facts about names.
Enter a name, get a fun fact. That’s it!
If you're getting started with Perplexity’s Sonar API, this is a very basic example you can try by just placing your own Perplexity Sonar API key at the point specified in the code shared on GitHub.
Based on the scenario, you can use any of the following Sonar models:
- sonar (lightweight search)
- sonar-pro (advanced search)
- sonar-deep-research (exhaustive research)
- sonar-reasoning (fast reasoning)
- sonar-reasoning-pro (premier reasoning)
You can deploy Flask apps on the web using one of the many options like Anaconda's PythonAnywhere. With a limited Beginner account, you can host one web app at your-username.pythonanywhere.com with restricted outbound Internet access from your apps at low CPU/bandwidth.
Comments
Post a Comment