gpt3 reprocessor update
This commit is contained in:
parent
191f815224
commit
0f59506b99
@ -364,10 +364,10 @@ class Plugin:
|
|||||||
config.set('decoder','seed',f'{datetime.now().microsecond}')
|
config.set('decoder','seed',f'{datetime.now().microsecond}')
|
||||||
try:
|
try:
|
||||||
if not type(self.bot.history.bounce)==bool:
|
if not type(self.bot.history.bounce)==bool:
|
||||||
print('<received bounce message>')
|
|
||||||
USER=self.bot.history.bounce['user']
|
USER=self.bot.history.bounce['user']
|
||||||
MESSAGE=self.bot.history.bounce['message']
|
MESSAGE=self.bot.history.bounce['message']
|
||||||
TARGET=self.bot.history.bounce['target']
|
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.maple_io.append({'user':USER,'message':MESSAGE,'target':TARGET})
|
||||||
self.bot.history.bounce=False
|
self.bot.history.bounce=False
|
||||||
except:
|
except:
|
||||||
@ -453,7 +453,7 @@ class Plugin:
|
|||||||
self.bot.history.push_maple_messages(maple_message)
|
self.bot.history.push_maple_messages(maple_message)
|
||||||
################################################################################### REPROCESSOR EOF
|
################################################################################### REPROCESSOR EOF
|
||||||
print(f'maple > {maple_message}')
|
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
|
return self.exit_strategy
|
||||||
#######################################################################################
|
#######################################################################################
|
||||||
def main(self):
|
def main(self):
|
||||||
|
@ -75,6 +75,8 @@ class Plugin:
|
|||||||
if not term[-1] == ".": term+="."
|
if not term[-1] == ".": term+="."
|
||||||
openai.api_key = OPENAPI_KEY
|
openai.api_key = OPENAPI_KEY
|
||||||
######################################################################################
|
######################################################################################
|
||||||
|
print(f"<<< openai: processing {target} {USER} message: {term}")
|
||||||
|
######################################################################################
|
||||||
MESSAGE_OK=True
|
MESSAGE_OK=True
|
||||||
TRAP_OK=True
|
TRAP_OK=True
|
||||||
LOOP_COUNT_LIMIT=1
|
LOOP_COUNT_LIMIT=1
|
||||||
@ -166,10 +168,10 @@ class Plugin:
|
|||||||
else:
|
else:
|
||||||
self.bot.privmsg(target, f"{COLOR}{_.strip()}\x0F")
|
self.bot.privmsg(target, f"{COLOR}{_.strip()}\x0F")
|
||||||
MESSAGE_OK=False
|
MESSAGE_OK=False
|
||||||
print('i am finished')
|
print('<<< openai finished >>>')
|
||||||
###################################################################################
|
###################################################################################
|
||||||
if LOOP_COUNT > LOOP_COUNT_LIMIT:
|
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}
|
self.bot.history.bounce={'user':USER,'message':term,'target':target}
|
||||||
#MESSAGE=f"{GREY}<<< {DRED}i got nothing to say {GREY}>>>"
|
#MESSAGE=f"{GREY}<<< {DRED}i got nothing to say {GREY}>>>"
|
||||||
#self.bot.privmsg(target, f"{USER}: {MESSAGE}")
|
#self.bot.privmsg(target, f"{USER}: {MESSAGE}")
|
||||||
|
Loading…
Reference in New Issue
Block a user