gpt3 reprocessor update

This commit is contained in:
.[d]. 2022-06-25 18:55:25 -05:00
parent 770fea9286
commit ad468c4324

@ -11,7 +11,6 @@ from random import randint as rint
from random import choices from random import choices
dir_path = os.path.dirname(os.path.realpath(__file__)) dir_path = os.path.dirname(os.path.realpath(__file__))
from glob import glob from glob import glob
import ipdb
########################################################################################### ###########################################################################################
OPENAPI_KEY = os.environ['OPENAPI_KEY'] OPENAPI_KEY = os.environ['OPENAPI_KEY']
########################################################################################### ###########################################################################################
@ -109,13 +108,12 @@ class Plugin:
TRAP_OK=False TRAP_OK=False
################################################################################### REPROCESSOR SOF ################################################################################### REPROCESSOR SOF
# SIMILARITY - QUERY ANSWER VS PERSONALITY PROFILE DATABASE # SIMILARITY - QUERY ANSWER VS PERSONALITY PROFILE DATABASE
#ipdb.set_trace()
if MESSAGE_OK: if MESSAGE_OK:
if self.bot.openai_history.similar(openai_message.lower().strip(),' '.join(self.start_chat_log.strip().splitlines())[:len(openai_message.strip())])>0.4: if self.bot.openai_history.similar(openai_message.lower().strip(),' '.join(self.start_chat_log.strip().splitlines())[:len(openai_message.strip())])>0.4:
self.openai_io.append({'user':USER,'message':MESSAGE,'target':target}) self.openai_io.append({'user':USER,'message':MESSAGE,'target':target})
print(f'openai - logic ! rejected // openai similarity - response too similar to persoanlity profile database') print(f'openai - logic ! rejected // openai similarity - response too similar to persoanlity profile database')
TRAP_OK=False TRAP_OK=False
################################################################################### ###################################################################################
# SIMILARITY - HISTORY # SIMILARITY - HISTORY
if MESSAGE_OK: if MESSAGE_OK:
for i in range(len(self.bot.openai_history.openai_messages)): for i in range(len(self.bot.openai_history.openai_messages)):