Skip to content

A python api to use labs.perplexity.ai

Notifications You must be signed in to change notification settings

ShaneOss/perplexityai

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

NOTE:

This stopped working due to Javascript/Bot checks after they moved to Cloudflare. For a working version using Selenium see: https://github.com/ShaneOss/perplexitylabs/

perplexityai

A python api to use labs.perplexity.ai

Usage

You can just import the Perplexity class and use it like this:

from Perplexity import Perplexity

perplexity = Perplexity()
answer = perplexity.search("What is the meaning of life?")
print(answer)

The model used can be updated in Perplexity.py

#Available Models
# llama-2-7b-chat
# llama-2-13b-chat
# llama-2-70b-chat
self.model = "llama-2-70b-chat"

You can even create a cli tool with it:

from Perplexity import Perplexity

perplexity = Perplexity()

while True:
    inp = str(input("> "))
    c = perplexity.search(inp)
    if c:
        print(c)

About

A python api to use labs.perplexity.ai

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%