Skip to main content

Sopel AI - an LLM enhanced chat bot plug-in

Project description

% sopel_ai(1) Version 1.0.12 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 Weir.

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 already installed in the target system and in the same environment as the 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

Other available commands if the standard Sopen infobot plugins are enabled:

Command Arguments Effect
.search Some question Search using Bing or DuckDuckGo
.dict Word Get a dictionary definition if one is available
.tr Word of phrase Translate to English
.w Word or topic Search Wikipedia for articles

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 .mymodel 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

Bugs

Feature requests and bug reports:

https://github.com/pr3d4t0r/sopel_ai/issues

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

sopel_ai-1.0.12-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file sopel_ai-1.0.12-py3-none-any.whl.

File metadata

  • Download URL: sopel_ai-1.0.12-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for sopel_ai-1.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 e85dad7ef64bf88775a48f7db47fc1996e294234b4ccb7400b2961cd571119f1
MD5 a676e847a8f0e0605e30a251d91d208a
BLAKE2b-256 f53a3020002811bde3d64395ab91e93a2e546c14d8787b7975ab7ce54a580fec

See more details on using hashes here.

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