Skip to main content

msgFlow is a simple chatbot framework for simple configuration, customization and connection with several services.

Project description

msgFlow

msgFlow is a simple chatbot framework written in Python for simple configuration, customization and connection with several services.

Installation

Prepare Python >= 3.9. Then install msgFlow from PyPI.

$ pip install msgflow

msgFlow separas dependent libraries for each service. To make all the services available, install msgFlow with the following options.

$ pip install msgflow[webapi,twitter,slack]

Quick Start

msgFlow requires a configuration file and an App script to run. To create those files, create your working directory first.

$ mkdir work
$ cd work/

msgFlow provides init command to generate the configuratio file and App script for you.

$ python -m msgflow.main init
$ ls
app.py  config.yml

Configuration file tells msgFlow which service is used to get inputs and return the response. and which App class is used. The App script defines the App class which defines how to generate a response from the input.

As a default, Config file uses stdin to get the input and show the output in the stdout.

Let us run the msgFlow with the Config setting. You can utilize the run command with --config_file option which specify the default config file.

$ python -m msgflow.main run --config_file config.yml
INFO:/work/msgflow/main.py:{"level": "info", "message": {"service": "CliService", "post_service": "CliService"}, "time": "2020-12-26 11:10:43.886375"}

The prompt you> waits for your input. Input your utterance there.

you> Hello
App got message: Message(text="Hello", dialog_id="you")
bot> Thank you for your message "Hello"!
you> World
App got message: Message(text="World", dialog_id="you")
bot> Thank you for your message "World"!

The default App class shows the message that what kind of message was reached, and then return the response with your input utterance.

To finish the conversation, input /exit.

you> /exit
Bye!

Service List

Name Description Flow message Post Respond to message Where to handle message
msgflow.service.CliService Service to get input from stdin and output to stdout o o o Foreground
msgflow.service.CronService Service to post on a regular basis o Foreground
msgflow.service.WebapiService Service to serve web API o o Foreground
msgflow.service.SlackService Service to work with Slack o o o Background
msgflow.service.TwitterSampleStreamService This service gets tweets via Twitter sampled stream v2 o Background

o: available, blank: unavailable

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

msgflow-0.6.0.tar.gz (11.1 kB view details)

Uploaded Source

File details

Details for the file msgflow-0.6.0.tar.gz.

File metadata

  • Download URL: msgflow-0.6.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for msgflow-0.6.0.tar.gz
Algorithm Hash digest
SHA256 a19baf719100e9e2b7f00003f6f4872c8c6f15232928cfa58648d3f1d7186233
MD5 b8dd6959b895ffcf948c731acc4b88e4
BLAKE2b-256 52403fe65fc97e877ba70946843cb15e70010c899225acb0caa3341918dce2cd

See more details on using hashes here.

Supported by

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