A simple framework for building complex dialogue systems.
Project description
A simple framework for building complex dialogue systems.
Installing
pip install Millet
A Simple Example
from typing import List
from millet import Agent, BaseSkill, BaseSkillClassifier
class MeetingSkill(BaseSkill):
def start(self, initial_message: 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) -> List[str]:
return ['meeting']
skill_classifier = SkillClassifier()
agent = Agent(skill_classifier=skill_classifier)
conversation = agent.conversation_with_user('Bob')
>>> conversation.query('Hello')
['What is your name?']
>>> conversation.query('Bob')
['Nice to meet you Bob!']
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Millet-1.0.2.tar.gz
(14.8 kB
view hashes)