A simple module to use Perplexity AI in Python.
python -m pip install -U perplexityai
Join my Discord server for live chat, support, or if you have any issues with this package.
- โญ Star the project: Star this repository. It means a lot to me! ๐
- ๐ Join my Discord Server: Chat with me and others. Join here:
from perplexityai import Perplexity
prompt = input("๐ฆ: ")
for a in Perplexity().generate_answer(prompt):
print(f"๐ค: {a['answer']}")
"""
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.