diff --git a/src/model/frame.py b/src/model/frame.py index bdbc717..66fad20 100644 --- a/src/model/frame.py +++ b/src/model/frame.py @@ -1,4 +1,6 @@ +from slot import Slot + class Frame: - def __init__(self, source: str, text: str): - self.source = source - self.text = text + def __init__(self, act: str, slots: list[Slot]): + self.slots = slots + self.act = act diff --git a/src/model/slot.py b/src/model/slot.py new file mode 100644 index 0000000..df4956f --- /dev/null +++ b/src/model/slot.py @@ -0,0 +1,4 @@ +class Slot: + def __init__(self, name, value=None): + self.name = name + self.value = value \ No newline at end of file diff --git a/src/service/dialog_policy.py b/src/service/dialog_policy.py new file mode 100644 index 0000000..a3cf40f --- /dev/null +++ b/src/service/dialog_policy.py @@ -0,0 +1,12 @@ +from model.frame import Frame +from model.dialogue_act import DialogueAct + +class DialogPolicy: + def __init__(self, frames: list[Frame]) -> None: + self.frames = frames + + def next_dialogue_act(self) -> Frame: + if self.frames[-1].act == "welcomemsg": + return Frame("welcomemsg", []) + else: + return Frame("canthelp", [])