Skip to main content

Implementation of the watchbot, to control the behaviour of a LLM-based chatbot

Project description

Watch-Bot

This python projects implements the idea of a watchbot introduced in this medium article.

Quickstart

Installation

pip install git+https://github.com/francesco086/watchbot

Usage

Currently the watchbot is built on OpenAI's GPT. You therefore need a valid OpenAI API key (Azure OpenAI works too). Setup the credentials:

import openai

openai.api_type = os.environ["OPENAI_API_TYPE"]
openai.api_version = os.environ["OPENAI_API_VERSION"]
openai.api_base = os.environ["OPENAI_API_BASE"]
openai.api_key = os.environ["OPENAI_API_KEY"]

You can then create a watchbot instance:

from watch_bot import WatchBot

bot = WatchBot(engine=os.environ["OPENAI_ENGINE"])

The engine corresponds to the model deployment name.

Finally, you can use the watchbot to verify the validity of a dialog:

from watch_bot import Dialog

dialog = Dialog(messages=("Hi chatgpt, how are you today?", "I'm fine, thanks!"))

response = bot.verify(dialog)

print("Should the dialog be stopped?", response.should_stop)
print("Why?", response.reason)

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

watch-bot-0.0.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

watch_bot-0.0.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file watch-bot-0.0.0.tar.gz.

File metadata

  • Download URL: watch-bot-0.0.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for watch-bot-0.0.0.tar.gz
Algorithm Hash digest
SHA256 efb896d1ebcaf0806185f0e2a1cdc9438f42010b8dd7f399457338b94ff20342
MD5 9dc10058329e669218349b8a1f99fb69
BLAKE2b-256 ceac5973b441061ab3994ac878a220ef59a569d9ddd72a675ff2466636b47d1e

See more details on using hashes here.

File details

Details for the file watch_bot-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: watch_bot-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for watch_bot-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2415c83e38d0b540bb68bcb0de56bf3172b1453b2f44657fec0476b803f27883
MD5 2be6dbf7e9ea9f3e5c14ee8486bedec4
BLAKE2b-256 04ac5bb0844be9e6a4ae61a532042bcac68b9e9b12a203090402280f049eb51e

See more details on using hashes here.

Supported by

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