Skip to content

A very basic Perplexity search script - simple as possible for use with agents. Uses the new Search API only i.e. treat this as you would a programmatic Google search (rather than expecting LLM-style answer to a question - for this, use Sonar etc.)

License

Notifications You must be signed in to change notification settings

DanMakingWithAI/basic-perplexity-search-api-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Basic Perplexity Search API script

A very basic Perplexity search script - simple as possible for use with agents.

Uses the new Search API only i.e. treat this as you would a programmatic Google keyword search (rather than expecting LLM-style answer to a question - for this, use Sonar etc.)

I added this script as a custom tool for my Letta agents for example (the schema shown was auto-generated by Letta)

Notes

  • Implemented a default of 5 results (rather then 10 as per the API defaults) as more results are likely too long to fit comfortably in context of subsequent LLM agent use.
  • Implemented docstring instructions around use of the country code that are specific to me and not honed:
    • Amend "GB" to your most relavant country code, or amend entirely if this advice to calling LLMs is not desired
    • Evolve wording (i.e. this is prompt engineering) if your agent goes off the rails e.g. it makes non-geographic searches country specific

Don't forget to add your Perplexity API key via whatever method is relevant to your use

About

A very basic Perplexity search script - simple as possible for use with agents. Uses the new Search API only i.e. treat this as you would a programmatic Google search (rather than expecting LLM-style answer to a question - for this, use Sonar etc.)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages