SD-project-22/trailminator/nlg.py

14 lines
424 B
Python
Raw Normal View History

2022-04-20 11:25:16 +02:00
import random
from urllib import response
2022-05-18 12:33:50 +02:00
2022-04-13 13:23:47 +02:00
class Nlg:
2022-04-20 11:25:16 +02:00
2022-06-01 16:25:19 +02:00
def __init__(self) -> None:
self.responses = {
"welcomemsg": ["I AM TRAIlMinATor!", "Cześć, jestem TrailMinator"],
"null": ["Can't hear you"]}
def response(self, response_type: str) -> str:
avail_resps = self.responses.get(response_type)
return avail_resps[random.randint(0, len(avail_resps)-1)]