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

Uploaded Source

Built Distribution

perplexityai-1.0.3-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: perplexityai-1.0.3.tar.gz
  • Upload date:
  • Size: 16.8 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.3.tar.gz
Algorithm Hash digest
SHA256 3583d44179bc02f9d9f56e4979177b680cd9276e748d46835561d521ae2f2c38
MD5 edc8c139a69a8cc6b5bcfce2de7874cc
BLAKE2b-256 a483444aacbb9a01864381b71a31841ba2fa4bf383cb62fb35189f220e505c32

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: perplexityai-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 17.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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 17fc3a3ba3b780069acd9a3fb4bdf682a1b2ac98abbe8bb9ba8e1b294fecf859
MD5 95dfb97d1dc0dcdb1c327cc4dcb242bd
BLAKE2b-256 bbe9f59d9cd884bfd761bb1a8796c50db0e88b40f7a6402cf1f241c5f4af7f42

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