Dodanie modulu taktyki dialogu
This commit is contained in:
parent
abe4577dd6
commit
a8bf975f12
@ -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
4
src/model/slot.py
Normal file
@ -0,0 +1,4 @@
|
||||
class Slot:
|
||||
def __init__(self, name, value=None):
|
||||
self.name = name
|
||||
self.value = value
|
12
src/service/dialog_policy.py
Normal file
12
src/service/dialog_policy.py
Normal 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", [])
|
Loading…
Reference in New Issue
Block a user