gpt3 reprocessor update

This commit is contained in:
.[d]. 2022-06-25 18:18:53 -05:00
parent 191f815224
commit 0f59506b99
2 changed files with 6 additions and 4 deletions

@ -364,10 +364,10 @@ class Plugin:
config.set('decoder','seed',f'{datetime.now().microsecond}')
try:
if not type(self.bot.history.bounce)==bool:
print('<received bounce message>')
USER=self.bot.history.bounce['user']
MESSAGE=self.bot.history.bounce['message']
TARGET=self.bot.history.bounce['target']
print(f"<<< mapleai: processing {TARGET} {USER} message: {MESSAGE}")
self.maple_io.append({'user':USER,'message':MESSAGE,'target':TARGET})
self.bot.history.bounce=False
except:
@ -453,7 +453,7 @@ class Plugin:
self.bot.history.push_maple_messages(maple_message)
################################################################################### REPROCESSOR EOF
print(f'maple > {maple_message}')
self.bot.privmsg(TARGET,f'{USER}: {maple_message}')
self.bot.privmsg(TARGET,f'\x02\x0302{USER:}\x0F\x02\x0304 ▶ \x0F{maple_message.lower()}')
return self.exit_strategy
#######################################################################################
def main(self):

@ -75,6 +75,8 @@ class Plugin:
if not term[-1] == ".": term+="."
openai.api_key = OPENAPI_KEY
######################################################################################
print(f"<<< openai: processing {target} {USER} message: {term}")
######################################################################################
MESSAGE_OK=True
TRAP_OK=True
LOOP_COUNT_LIMIT=1
@ -166,10 +168,10 @@ class Plugin:
else:
self.bot.privmsg(target, f"{COLOR}{_.strip()}\x0F")
MESSAGE_OK=False
print('i am finished')
print('<<< openai finished >>>')
###################################################################################
if LOOP_COUNT > LOOP_COUNT_LIMIT:
print(f"bouncing {target} {USER} message to offline ai: {term}")
print(f"<<< openai failed: bouncing to mapleai >>>")
self.bot.history.bounce={'user':USER,'message':term,'target':target}
#MESSAGE=f"{GREY}<<< {DRED}i got nothing to say {GREY}>>>"
#self.bot.privmsg(target, f"{USER}: {MESSAGE}")