Coder Social home page Coder Social logo

colorfulscoop / msgflow Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 154 KB

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

License: MIT License

Python 97.26% Shell 2.74%
chatbot conversational-ai conversational-ai-platform chatbot-framework python yaml-configuration

msgflow's Introduction

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,slack,cron]

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

Check available services in docs.

msgflow's People

Contributors

noriyukipy avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.