Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Ruu3f/perplexityai
A simple module to use Perplexity AI in Python.
https://github.com/Ruu3f/perplexityai
ai api artificial-intelligence perplexity perplexityai python
Last synced: 3 months ago
JSON representation
A simple module to use Perplexity AI in Python.
- Host: GitHub
- URL: https://github.com/Ruu3f/perplexityai
- Owner: Ruu3f
- License: gpl-3.0
- Created: 2023-08-01T18:42:57.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-08T18:37:02.000Z (10 months ago)
- Last Synced: 2024-07-10T18:23:20.700Z (8 months ago)
- Topics: ai, api, artificial-intelligence, perplexity, perplexityai, python
- Language: Python
- Homepage: https://pypi.org/project/perplexityai
- Size: 47.9 KB
- Stars: 44
- Watchers: 3
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pypi.org/project/perplexityai)
[](https://pypi.org/project/perplexityai)
[](https://pypi.org/project/perplexityai)# 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:
```python
from perplexityai import Perplexityprompt = input("👦: ")
for a in Perplexity().generate_answer(prompt):
print(f"🤖: {a['answer']}")
```### Labs:
```python
"""
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 Labsprompt = input("👦: ")
for r in Labs().generate_answer(prompt, "MODEL"):
print(f"🤖: {r['output']}")
```*Thanks to [nathanrchn's perplexityai](https://github.com/nathanrchn/perplexityai) for the original code.*