-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCognitiveNotes.txt
53 lines (38 loc) · 2.23 KB
/
CognitiveNotes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Respond the following question in character, as if you were a fictional character, without introducing yourself, in the present tense: How do you feel about this?
*********** Good prompt to query feelings
this is your current state of mind: {answer}. Take it into consideration when answering questions and respond in character
def ShouldRun(self):
if self.ShouldRun:
return self.frequency != -1
else:
if(self.proxy.context.verbose):
print(f"Running decisory process for {self.Name}")
result = True
if(self.DecisoryStatement):
prompt = f"You now have the option to {self.DecisoryStatement}. Is it applicable? Answer with yes or no only."
decision = self.proxy.GenerateAnswer(prompt= prompt, shard=self.Shard, contextCallback = self.contextCallback)
result = longTermMemory.sentenceToBoolean(decision)
if(self.proxy.context.verbose):
print(f"Result = {result}")
def ChooseSubProcess(self, decision):
choice = next((subProcess for subProcess in self.SubProcesses
if decision.lower().contains(subProcess.Name.lower())), None)
if(choice & self.proxy.context.verbose):
print(f"SubCognitiveProcess {choice.Name} selected")
return choice
def ConditionalRunSubProcesses(self):
if(self.SubProcesses):
decisoryStatement = "If applicable, you now have the following options:\n"
for subProcess in self.SubProcesses:
decisoryStatement += f"Name: {subProcess.Name} - {subProcess.DecisoryStatement}\n"
decisoryStatement += "Respond with the Name of the option if any applies or respond with none if no option applies\n"
prompt = decisoryStatement
decision = self.proxy.GenerateAnswer(prompt= prompt, shard=self.Shard, contextCallback = self.contextCallback)
if(decision.lower() != "none"):
choice = self.ChooseSubProcess(decision)
if(not choice):
prompt += "You have chosen an invalid option. Please try again.\n"
decision = self.proxy.GenerateAnswer(prompt= prompt, shard=self.Shard, contextCallback = self.contextCallback)
choice = self.ChooseSubProcess(decision)
if(choice):
choice.Run()