Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.
/ perplexityai Public archive

A simple module to use Perplexity AI in Python.

License

Notifications You must be signed in to change notification settings

Ruu3f/perplexityai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PyPI Downloads Status

perplexityai

A simple module to use Perplexity AI in Python.

Get started:

python -m pip install -U perplexityai

Support this repository:

  • Star the project: Star this repository. It means a lot to me! 💕

Example:

Perplexity:

from perplexityai import Perplexity

prompt = input("👦: ")
for a in Perplexity().generate_answer(prompt):
    print(f"🤖: {a['answer']}")

Labs:

"""
Models:
[
    "mixtral-8x7b-instruct",
    "llava-7b-chat",
    "llama-2-70b-chat",
    "codellama-34b-instruct",
    "mistral-7b-instruct",
    "pplx-7b-chat",
    "pplx-70b-chat",
    "pplx-7b-online",
    "pplx-70b-online",
]
"""
from perplexityai import Labs

prompt = input("👦: ")
for r in Labs().generate_answer(prompt, "MODEL"): 
    print(f"🤖: {r['output']}")

Thanks to nathanrchn's perplexityai for the original code.