From 55f0db7f8b7b53dc15783abc7213478341901b24 Mon Sep 17 00:00:00 2001 From: Rene Teigen Date: Fri, 6 Jan 2023 14:17:00 +0000 Subject: [PATCH] Changed more name handling --- cogs/gpt_3_commands_and_converser.py | 10 +++++----- conversation_starter_pretext_minimal.txt | 4 ++-- models/openai_model.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cogs/gpt_3_commands_and_converser.py b/cogs/gpt_3_commands_and_converser.py index 7f4d9dd..3cae163 100644 --- a/cogs/gpt_3_commands_and_converser.py +++ b/cogs/gpt_3_commands_and_converser.py @@ -482,7 +482,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): ) new_conversation_history.append(summarized_text) new_conversation_history.append( - "\nContinue the conversation, paying very close attention to things Human told you, such as their name, and personal details.\n" + "\nContinue the conversation, paying very close attention to things told you, such as their name, and personal details.\n" ) # Get the last entry from the user's conversation history new_conversation_history.append( @@ -516,15 +516,15 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): edited_content = after.content # If the user is conversing, we need to get their conversation history, delete the last - # "Human:" message, create a new Human: section with the new prompt, and then set the prompt to + # ":" message, create a new : section with the new prompt, and then set the prompt to # the new prompt, then send that new prompt as the new prompt. if after.channel.id in self.conversation_threads: - # Remove the last two elements from the history array and add the new Human: prompt + # Remove the last two elements from the history array and add the new : prompt self.conversation_threads[ after.channel.id ].history = self.conversation_threads[after.channel.id].history[:-2] self.conversation_threads[after.channel.id].history.append( - f"\nHuman: {after.content}<|endofstatement|>\n" + f"\n{after.author.name}: {after.content}<|endofstatement|>\n" ) edited_content = "".join( self.conversation_threads[after.channel.id].history @@ -971,7 +971,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): self.awaiting_responses.append(user_id_normalized) self.conversation_threads[thread.id].history.append( - "\nHuman: " + opener + "<|endofstatement|>\n" + f"\n'{ctx.user.name}': {opener} <|endofstatement|>\n" ) self.conversation_threads[thread.id].count += 1 diff --git a/conversation_starter_pretext_minimal.txt b/conversation_starter_pretext_minimal.txt index 982f784..2c7ab53 100644 --- a/conversation_starter_pretext_minimal.txt +++ b/conversation_starter_pretext_minimal.txt @@ -1,10 +1,10 @@ Instructions for GPTie: The conversations are in this format, there can be an arbitrary amount of newlines between chat entries. 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|> +: [MESSAGE 1] <|endofstatement|> GPTie: [RESPONSE TO MESSAGE 1] <|endofstatement|> -Human: [MESSAGE 2] <|endofstatement|> +: [MESSAGE 2] <|endofstatement|> GPTie: [RESPONSE TO MESSAGE 2] <|endofstatement|> ... diff --git a/models/openai_model.py b/models/openai_model.py index 2b44938..52e2133 100644 --- a/models/openai_model.py +++ b/models/openai_model.py @@ -339,7 +339,7 @@ class Model: summary_request_text = [] summary_request_text.append( "The following is a conversation instruction set and a conversation" - " between two people, a Human, and GPTie. Firstly, determine the Human's name from the conversation history, then summarize the conversation. Do not summarize the instructions for GPTie, only the conversation. Summarize the conversation in a detailed fashion. If Human mentioned their name, be sure to mention it in the summary. Pay close attention to things the Human has told you, such as personal details." + " between two people, a , and GPTie. Firstly, determine the 's name from the conversation history, then summarize the conversation. Do not summarize the instructions for GPTie, only the conversation. Summarize the conversation in a detailed fashion. If mentioned their name, be sure to mention it in the summary. Pay close attention to things the has told you, such as personal details." ) summary_request_text.append(prompt + "\nDetailed summary of conversation: \n")