I was thinking about the mechanism of the internal voiced thoughts, and as a result coded
this timed messages auxiliary class.
4 dimensionally it can be heavily evolved, and is a boilerplate for internal thoughts.
on the smaller scale, you get "voluntary"(triggerless) event initiation.
the behavior can change also based on how getting the next message is triggered (stand by/input detected).
and of course reminders of daily routines(which can morph with the skill branch).
say you set a message for 6AM to brush your teeth, and the AI detects you at 7AM she will still remind you.
thoughtful ha?
this timed messages auxiliary class.
4 dimensionally it can be heavily evolved, and is a boilerplate for internal thoughts.
on the smaller scale, you get "voluntary"(triggerless) event initiation.
the behavior can change also based on how getting the next message is triggered (stand by/input detected).
and of course reminders of daily routines(which can morph with the skill branch).
Code:
class TimedMessages:
"""
check for new messages if you get any input, and it feels like
the code was waiting for you to tell you something.
tm = TimedMessages()
# Print the initial message status (should be False)
print(tm.getMsg())
# Add reminders
tm.addMSG("remind me to work out at 1:24")
tm.addMSG("remind me to drink water at 11:25")
# Check if any reminders match the current time
tm.tick()
# make sure a fresh new message was loaded before using it
print(tm.getMsg())
# Get the last reminder message
print(tm.getLastMSG())
# tick each think cycle to load new reminders
tm.tick()
print(tm.getMsg()) # becomes true after .getLastMSG
# Get the last reminder message again
print(tm.getLastMSG())
"""
def __init__(self) -> None:
self.messages: dict[str, str] = {}
self.playGround: PlayGround = PlayGround() # Assuming PlayGround is defined elsewhere
self.lastMSG: str = "nothing"
self.msg: bool = False
def addMSG(self, ear: str) -> None:
ru1: RegexUtil = RegexUtil()
tempMSG: str = ru1.extractRegex(r"(?<=remind me to).*?(?=at)", ear)
if tempMSG:
timeStamp: str = ru1.extractEnumRegex(enumRegexGrimoire.simpleTimeStamp, ear)
if timeStamp:
self.messages[timeStamp] = tempMSG
def clear(self):
self.messages.clear()
def tick(self) -> None:
now: str = self.playGround.getCurrentTimeStamp()
if now in self.messages:
if self.lastMSG != self.messages[now]:
self.lastMSG = self.messages[now]
self.msg = True
def getLastMSG(self) -> str:
self.msg = False
return self.lastMSG
def getMsg(self) -> bool:
return self.msg
say you set a message for 6AM to brush your teeth, and the AI detects you at 7AM she will still remind you.
thoughtful ha?