Sopel AI - an LLM enhanced chat bot plug-in
Project description
% sopel_ai(1) Version 1.0.11 chatbot plugin
Name
Sopel AI - AI query/response plugin
Synopsis
Enable Sopel to respond to queries using a Perplexity AI back-end, featuring the ability to plug different LLMs on a per-user basis.
pip install -U sopel_ai
sopel configure
sopel
From a channel where sopel_ai is present enter a query:
.q Summarize the plot of The Martian by Andy Weird.
This plugin requires an API key issued by the service provider.
Installation
pip install -U sopel_ai
The installation assumes that the Sopel chatbot is alreasy installed in the
target system and in the same environment as pip
installation.
Confirm the installed package and version:
echo "import sopel_ai ; print(sopel_ai.__VERSION__)" | python
Commands
Listed in order of frequency of use:
Command | Arguments | Effect |
---|---|---|
.q |
Some question | The model produces a response |
.qpm |
Some question | Same as .q but in private message |
.models |
n/a | Lists all models that sopel_ai supports |
.mymodel |
number | Request or set the model to use for the current /nick |
.req |
n/a | Return the GitHub URL for sopel_ai feature requests |
.bug |
n/a | Same as .req |
Usage
The most common usage is to enter a query in-channel or private message, and wait for the bot to respond.
.q Quote the Three Law of Robotics as a list and without details.
Users may check the current model used for producing their responses by issuing:
.mymodel
The bot produces a numbered list of supported models by issuing:
.models
Users are welcome to change the default model to one of those listed by issuing
the .model
command followed by the item number for the desired model from the
list:
.mymodel 1
Users may request private instead of in-channel responses:
.qpm Quote the Three Laws of Robotics and give me examples.
Users can query the bot plugin and AI provider using:
.mver
AI providers
The current version uses the Perplexity AI models and API. Future versions may support other providers.
API Key
All AI services providers require an API key for access. This version of sopel_ai uses one environment variable and two mechanisms for resolving it:
export PERPLEXITY_API_KEY="pplx-2a45baaf"
Or use the .env
file to store this and other secretes. The underlying
PerplexiPy module uses dotenv
package for secrets resolution.
License
The Sopel AI Sopel plugin, package, documentation, and examples are licensed under the BSD-3 open source license at https://github.com/pr3d4t0r/sopel_ai/blob/master/LICENSE.txt.
See also
- sopel_ai API documentation at https://pr3d4t0r.github.io/sopel_ai
- PerplexiPy high level API interface to Perplexity AI https://pypi.org/project/perplexipy
- Sopel bot home page: https://sopel.chat/
Bugs
Feature requests and bug reports:
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 Distributions
Built Distribution
File details
Details for the file sopel_ai-1.0.11-py3-none-any.whl
.
File metadata
- Download URL: sopel_ai-1.0.11-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16568eda37e2008f41972081809e1996a1035892eb49089ed30dac6b6a987f6e |
|
MD5 | 9b672a4dccfcb10a54dc0cae59f769e6 |
|
BLAKE2b-256 | 1e113f0f58a21ea1a8d22c4ad3f2b2f93a8899f7fa928c418cb8de10f9f16248 |