Add basic tactic

This commit is contained in:
karoel2 2022-06-08 10:23:01 +02:00
parent 3d47f53813
commit f4b8ba5860
2 changed files with 22 additions and 25 deletions

View File

@ -11,13 +11,15 @@ def main():
text = input('>>>')
frame = analizator_jezyka_naturalnego(text)
print(frame)
#{'act': 'notifications', 'slots': [('time_when', None), ('liczba', ''), ('timeunit', None)]}
state = monitor_stanu_dialogowego(frame)
state = monitor_stanu_dialogowego(frame, frame)
print(state)
questions = taktyka_dialogu(frame) # todo dodac stan
generator_jezyka_nautalnego(frame, questions, state)
# questions = taktyka_dialogu(state) # todo dodac stan
#
# generator_jezyka_nautalnego(frame, questions, state)
if __name__ == '__main__':
main()

View File

@ -1,26 +1,21 @@
from enum import Enum
class Questions(Enum):
TIME = "time"
REPO = "repo"
NONE = "none"
def taktyka_dialogu(state, frame):
if state['current_context'] in ['hello', 'pomoc', 'bye']:
return short_thread(state)
else:
return long_thread(state)
#todo taktyka ma zwracać bardziej złożony obiekt
def taktyka_dialogu(frame):
return questions(frame)
def short_thread(state):
if state['current_context'] == 'pomoc':
pass
#TODO
else:
return state['current_context']
#todo dodac wiecej casow
#brac pod uwage stan
def questions(frame):
for slot in frame['slots']:
if slot[0] == "time_when" and slot[1] == None:
return Questions.TIME
if slot[0] == "repo" and (slot[1] == None or slot[1] == ""):
return Questions.REPO
return Questions.NONE
def long_thread(state):
state['topics']
#todo dodać mock github api
#todo dodać mock github api