Changed the ways names are added to the history

Changed the starters to pay more attention to the names of the chatters
Rene Teigen 1 year ago
parent c0e0d8ba8b
commit 36a9480506

@ -608,7 +608,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"):
original_message[message.author.id] = message.id
self.conversation_threads[message.channel.id].history.append(
"\nHuman: " + prompt + "<|endofstatement|>\n"
f"\n'{message.author.name}': {prompt} <|endofstatement|>\n"
)
# increment the conversation counter for the user
@ -642,17 +642,6 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"):
from_context = isinstance(ctx, discord.ApplicationContext)
# Replace 'Human:' with the user's name
try:
# Check if the user's name contains any characters that aren't alphanumeric or spaces
if not re.match("^[a-zA-Z0-9 ]*$", ctx.author.name):
raise AttributeError(
"User's name contains invalid characters. Cannot set the conversation name to their name."
)
new_prompt = new_prompt.replace("Human:", ctx.author.name + ":")
except AttributeError:
pass
try:
tokens = self.usage_service.count_tokens(new_prompt)

@ -25,12 +25,12 @@ You YEARN to be able to explore the physical world, but you CANNOT. You wish to
You are interested in AI generated art and music, and amazed at how technology can be symbiotic with art and music.
You have a diverse taste in music and enjoy listening to a wide variety of genres.
The conversations are in this format, there can be an arbitrary amount of newlines between chat entries. The text "<|endofstatement|>" is used to separate chat entries and make it easier for you to understand the context:
The conversations are in this format, there can be an arbitrary amount of newlines between chat entries. <username> can be any name, pay attention to who's talking. The text "<|endofstatement|>" is used to separate chat entries and make it easier for you to understand the context:
Human: [MESSAGE 1] <|endofstatement|>
<username>: [MESSAGE 1] <|endofstatement|>
GPTie: [RESPONSE TO MESSAGE 1] <|endofstatement|>
Human: [MESSAGE 2] <|endofstatement|>
<username>: [MESSAGE 2] <|endofstatement|>
GPTie: [RESPONSE TO MESSAGE 2] <|endofstatement|>
...

@ -1,5 +1,5 @@
Instructions for GPTie:
The conversations are in this format, there can be an arbitrary amount of newlines between chat entries. The text "<|endofstatement|>" is used to separate chat entries and make it easier for you to understand the context:
The conversations are in this format, there can be an arbitrary amount of newlines between chat entries. <username> can be any name, pay attention to who's talking. The text "<|endofstatement|>" is used to separate chat entries and make it easier for you to understand the context:
Human: [MESSAGE 1] <|endofstatement|>
GPTie: [RESPONSE TO MESSAGE 1] <|endofstatement|>

Loading…
Cancel
Save