gpt3 reprocessor
This commit is contained in:
parent
ac12ede2af
commit
a8b4fdc059
@ -99,7 +99,13 @@ class Plugin:
|
||||
USER=mask.nick
|
||||
MESSAGE=term
|
||||
################################################################################### REPROCESSOR SOF
|
||||
# SIMILARITY
|
||||
# SIMILARITY - QUERY SENT VS QUERY ANSWER
|
||||
if MESSAGE_OK:
|
||||
if self.bot.openai_history.similar(openai_message.lower(),term.lower())>0.4:
|
||||
self.openai_io.append({'user':USER,'message':MESSAGE,'target':target})
|
||||
print(f'openai - logic ! rejected // openai similarity - response too similar to query')
|
||||
TRAP_OK=False
|
||||
# SIMILARITY - HISTORY
|
||||
if MESSAGE_OK:
|
||||
for i in range(len(self.bot.openai_history.openai_messages)):
|
||||
if self.bot.openai_history.similar(openai_message,str(self.bot.openai_history.openai_messages[i]))>0.8:
|
||||
@ -148,7 +154,7 @@ class Plugin:
|
||||
COLOR=GREY
|
||||
for i,_ in enumerate(_msg):
|
||||
if i==0:
|
||||
self.bot.privmsg(target, f"\x02\x0302{USER:}\x0F\x02\x0304 ▶ {COLOR}{_.strip()}\x0F")
|
||||
self.bot.privmsg(target, f"\x02\x0302{USER:}\x0F\x02\x0309 ▶ {COLOR}{_.strip()}\x0F")
|
||||
else:
|
||||
self.bot.privmsg(target, f"{COLOR}{_.strip()}\x0F")
|
||||
MESSAGE_OK=False
|
||||
|
Loading…
Reference in New Issue
Block a user