Frames in taktyka_dialogu

This commit is contained in:
emkarcinos 2022-04-20 10:55:53 +02:00
parent 012dd6e2a3
commit c584b99d95
2 changed files with 6 additions and 6 deletions

View File

@ -10,7 +10,7 @@ def main():
text = input('>>>')
frame = analizator_jezyka_naturalnego(text)
state = monitor_stanu_dialogowego(frame)
response_frames = taktyka_dialogu(state)
response_frames = taktyka_dialogu(state, frame)
generator_jezyka_nautalnego(response_frames)
if __name__ == '__main__':

View File

@ -10,18 +10,18 @@ def check_condition(state, conditions, type=all):
return False
def taktyka_dialogu(state):
if should_respond_gently(state):
def taktyka_dialogu(state, frame):
if should_respond_gently(frame):
return [hello_act, name_response_act]
if should_prompt(state):
if should_prompt(frame):
return [hello_act, help_response_act]
if should_respond_cold(state):
if should_respond_cold(frame):
return [name_response_act]
return [unknown_act]
def should_respond_gently(state):
return check_condition(state, [hello_act, name_request_act])
return check_condition(state, [hello_act, name_request_act])
def should_prompt(state):