/perplexitylabs

Primary LanguagePythonGNU General Public License v2.0GPL-2.0

perplexitylabs

A python api to use labs.perplexity.ai using Selenium.

Requirements:

pip install fake-useragent beautifulsoup4 selenium selenium-wire

Usage

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

from Perplexity_Selenium 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
# codellama-34b-instruct
# 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_Selenium import Perplexity

perplexity = Perplexity()

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