Systemy_dialogowe/system_mockup/taktyka_dialogu.py
2022-04-20 09:14:16 +02:00

32 lines
762 B
Python

from os import stat
from re import S
from acts import *
def check_condition(state, conditions, type=all):
if type(i in state for i in conditions):
return True
return False
def taktyka_dialogu(state):
if should_respond_gently(state):
return [hello_act, name_response_act]
if should_prompt(state):
return [help_response_act]
if should_respond_cold(state):
return [name_response_act]
return [unknown_act]
def should_respond_gently(state):
return check_condition(state, [hello_act, name_request_act])
def should_prompt(state):
return check_condition(state, [hello_act], any)
def should_respond_cold(state):
return check_condition(state, [name_request_act])