Skip to main content
PyCon US is happening May 14th-22nd in Pittsburgh, PA USA.  Learn more

A simple framework for building complex dialogue systems.

Project description

A simple framework for building complex dialogue systems.

https://badge.fury.io/py/Millet.svg Documentation Status https://travis-ci.org/odryfox/millet.svg?branch=master https://coveralls.io/repos/github/odryfox/millet/badge.svg?branch=master

Installing

pip install Millet

A Simple Example

from typing import Dict, List
from millet import Agent, BaseSkill, BaseSkillClassifier


class MeetingSkill(BaseSkill):
    def execute(self, initial_message: str, user_id: str):
        name = self.ask(question='What is your name?')
        self.say(f'Nice to meet you {name}!')


class SkillClassifier(BaseSkillClassifier):
    @property
    def skills_map(self) -> Dict[str, BaseSkill]:
        return {
            'meeting': MeetingSkill(),
        }

    def classify(self, message: str, user_id: str) -> List[str]:
        return ['meeting']


skill_classifier = SkillClassifier()
agent = Agent(skill_classifier=skill_classifier)
conversation = agent.conversation_with_user('100500')
>>> conversation.process_message('Hello')
['What is your name?']
>>> conversation.process_message('Bob')
['Nice to meet you Bob!']

Supported by

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