A simple module to use Perplexity AI in Python.
Project description
perplexityai
A simple module to use Perplexity AI in Python.
Get started:
python -m pip install -U perplexityai
Join my Discord server for live chat, support, or if you have any issues with this package.
Support this repository:
- ⭐ Star the project: Star this repository. It means a lot to me! 💕
- 🎉 Join my Discord Server: Chat with me and others. Join here:
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
perplexityai-1.0.4.tar.gz
(16.6 kB
view hashes)
Built Distribution
Close
Hashes for perplexityai-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32b2027cc3bf3e7859c6d1f20fdae586bbc3941a4ad6ff97364bc5a0a8a6af3c |
|
MD5 | 17736279e7974646f9e8d39a2f371f25 |
|
BLAKE2b-256 | 230d7becafaf0c96f8b70b28fe623009bb72728654b850e557822216e0c74724 |