bug squash!

Kaveen Kumarasinghe 2 years ago
parent f360741ad2
commit 4de4ab3f6e

@ -350,7 +350,7 @@ class RedoButton(discord.ui.Button["SaveView"]):
# Get the message and the prompt and call encapsulated_send # Get the message and the prompt and call encapsulated_send
message = redo_users[user_id].message message = redo_users[user_id].message
prompt = redo_users[user_id].prompt prompt = redo_users[user_id].prompt
response_message = redo_users[user_id].response_message response_message = redo_users[user_id].response
message = await interaction.response.send_message( message = await interaction.response.send_message(
f"Regenerating the image for your original prompt, check the original message.", f"Regenerating the image for your original prompt, check the original message.",
ephemeral=True, ephemeral=True,

@ -350,8 +350,8 @@ class GPT3ComCon(commands.Cog, name="GPT3ComCon"):
) )
await self.end_conversation(message) await self.end_conversation(message)
def summarize_conversation(self, message, prompt): async def summarize_conversation(self, message, prompt):
response = self.model.send_summary_request(message, prompt) response = await self.model.send_summary_request(message, prompt)
summarized_text = response["choices"][0]["text"] summarized_text = response["choices"][0]["text"]
new_conversation_history = [] new_conversation_history = []
@ -389,7 +389,7 @@ class GPT3ComCon(commands.Cog, name="GPT3ComCon"):
"give me one moment!" "give me one moment!"
) )
self.summarize_conversation(message, new_prompt) await self.summarize_conversation(message, new_prompt)
# Check again if the prompt is about to go past the token limit # Check again if the prompt is about to go past the token limit
new_prompt = ( new_prompt = (
@ -445,7 +445,7 @@ class GPT3ComCon(commands.Cog, name="GPT3ComCon"):
if not response_message: if not response_message:
if len(response_text) > self.TEXT_CUTOFF: if len(response_text) > self.TEXT_CUTOFF:
await self.paginate_and_send( await self.paginate_and_send(
response_text, message response_text.replace("<|endofstatement|>", ""), message
) # No paginations for multi-messages. ) # No paginations for multi-messages.
else: else:
response_message = await message.reply( response_message = await message.reply(
@ -550,9 +550,14 @@ class GPT3ComCon(commands.Cog, name="GPT3ComCon"):
if not message.content.startswith("!g") and not conversing: if not message.content.startswith("!g") and not conversing:
return return
# Dont accept !draw in a conversation
if conversing and "!draw" in message.content: if conversing and "!draw" in message.content:
return return
# Don't accept !imgoptimize in a conversation
if conversing and "!imgoptimize" in message.content:
return
# If the user is conversing and they want to end it, end it immediately before we continue any further. # If the user is conversing and they want to end it, end it immediately before we continue any further.
if conversing and message.content.lower() in self.END_PROMPTS: if conversing and message.content.lower() in self.END_PROMPTS:
await self.end_conversation(message) await self.end_conversation(message)

@ -297,7 +297,7 @@ class Model:
summary_request_text = [] summary_request_text = []
summary_request_text.append( summary_request_text.append(
"The following is a conversation instruction set and a conversation" "The following is a conversation instruction set and a conversation"
" between two people named Human, and GPTie. 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 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."
) )
summary_request_text.append(prompt + "\nDetailed summary of conversation: \n") summary_request_text.append(prompt + "\nDetailed summary of conversation: \n")

Loading…
Cancel
Save