Skip to main content

A simple module to use Perplexity AI in Python.

Project description

PyPI Downloads Status

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:

DiscordWidget

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


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.5.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

perplexityai-1.0.5-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file perplexityai-1.0.5.tar.gz.

File metadata

  • Download URL: perplexityai-1.0.5.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for perplexityai-1.0.5.tar.gz
Algorithm Hash digest
SHA256 9254d757fdeda880f3c265d4c045673859676a3c4d67cf071cc721617f0657f8
MD5 64d44bff8b1df4603c4e21cd14263c84
BLAKE2b-256 20003cb07c17c9b63c8759055be5b7a0b42dfe676def45f992d28630c8a04638

See more details on using hashes here.

Provenance

File details

Details for the file perplexityai-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: perplexityai-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for perplexityai-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 41c34214801ae3e9e258f360ec25aa88b65fb9d2e82441a4df18496efdce2c4f
MD5 122201a001de9eb98d80c912183aff14
BLAKE2b-256 c80e8832a03976c98daa7cc51e0c4bcc8ffc69ce7767e5bac24a928b0b8ad3af

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page