Skip to main content

OrionBot: A Python bot training framework

OrionBot is a Python library that allows you to easily train and run chatbots, fully customizable.

Installation

To install OrionBot, simply use pip:

pip install orionbot

Usage

To use OrionBot, simply import the Chatbot class and create a new instance with a name:

from orionbot import Chatbot
bot = Chatbot("My Bot")

Training

You can train your bot by calling the train method with an input text and a response text:

bot.train("Hi", "Hello there!")

You can also train your bot from a file:

bot.train_from_file("training_data.json")

Or, you can train your bot from the default file:

bot.train_from_default_file()

Getting Responses

To get a response from your bot, simply call the get_response method with an input text:

response = bot.get_response("Hi")
print(response)  # "Hello there!"

If your bot does not understand the input text, it will return a default response. You can set this response by calling the set_no_response_message method:

bot.set_no_response_message("I'm sorry, I didn't understand that.")

Training Toggle

You can enable or disable training by calling the enable_training or disable_training methods:

bot.enable_training()
bot.disable_training()

Examples

Here are some examples of how to use OrionBot:

Example 1: Simple greeting bot

from orionbot import Chatbot

bot = Chatbot("Greeting Bot")

bot.train("Hi", "Hello there!")
bot.train("Hello", "Hi there!")
bot.train("Hey", "Hiya!")

print(bot.get_response("Hi"))  # "Hello there!"
print(bot.get_response("Hey"))  # "Hiya!"
print(bot.get_response("What's up?"))  # "I'm sorry, I didn't understand that."

Example 2: Movie recommendation bot

from orionbot import Chatbot

bot = Chatbot("Movie Bot")

bot.train("What's a good movie to watch?", "I recommend watching The Shawshank Redemption.")
bot.train("What's your favorite movie?", "My favorite movie is The Godfather.")
bot.train("Have you seen Inception?", "Yes, Inception is a great movie!")

print(bot.get_response("What's a good movie to watch?"))  # "I recommend watching The Shawshank Redemption."
print(bot.get_response("What's your favorite movie?"))  # "My favorite movie is The Godfather."
print(bot.get_response("Have you seen The Matrix?"))  # "I'm sorry, I didn't understand that."

You can find more information on our GitHub repository

Table of Contents

Metadata

Release files for orionbot 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for orionbot 1.2.1
File Size Uploaded Provenance Actions
orionbot-1.2.1.tar.gz 3.2 kB Without provenance Details for orionbot-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for orionbot 1.2.1
File Interpreter ABI Platform Actions
orionbot-1.2.1-py2.py3-none-any.whl Python 3, Python 2 none any Details for orionbot-1.2.1-py2.py3-none-any.whl

Total release size: 6.4 kB

Release files / orionbot-1.2.1.tar.gz

Download URL orionbot-1.2.1.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1d954180f11f6b8e4fd8c0ab9e60b2b409e7794b99cf2c84d75e19f203ab2f07
BLAKE2b-256 checksum
How to use checksums
fbf7ec247376864f240396e8eae2d730d9994b57afcbfbba1f9d1911c52077b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.0

Release files / orionbot-1.2.1-py2.py3-none-any.whl

Download URL orionbot-1.2.1-py2.py3-none-any.whl
Size 3.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
092419cff7b7ab910c5373ef57cda26a5ca273a6db5bec1e2635f5c27aa16788
BLAKE2b-256 checksum
How to use checksums
dcf9787fd3130237bdd3f8c3c5b61e8308275077a1f62081bf52771fcecf400b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.0

Security for orionbot 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page