Skip to content

phamxtien/perplexityai

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

perplexityai

A python api to use 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.json_answer_text["answer"])
perplexity.close()

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.json_answer_text["answer"])

perplexity.close()

About

A python api to use perplexity.ai

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%