Dodanie modulu taktyki dialogu

This commit is contained in:
s495727 2024-05-03 00:21:47 +02:00
parent abe4577dd6
commit a8bf975f12
3 changed files with 21 additions and 3 deletions

View File

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

4
src/model/slot.py Normal file
View File

@ -0,0 +1,4 @@
class Slot:
def __init__(self, name, value=None):
self.name = name
self.value = value

View File

@ -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", [])