- **AUTOMATIC CHAT SUMMARIZATION!** - When the context limit of a conversation is reached, the bot will use GPT3 itself to summarize the conversation to reduce the tokens, and continue conversing with you, this allows you to chat for a long time!
- **DALL-E Image Generation**
- **REDO ON EDIT** - When you edit a prompt, it will automatically be resent to GPT3 and the response updated!
new_conversation_history.append("\nThis conversation has some context from earlier, which has been summarized as follows: ")
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")
# Get the last entry from the user's conversation history
# Now, iterate through all the statements. If there are multiple statements that start with "GPTie" in a row,
# we want to remove all but the FIRST one.
# We can do this by iterating through the statements, and if we encounter a GPTie: statement, we can check if the previous statement was a GPTie: statement.
# If it was, we can remove the current statement from the history.
Sometimes, if the conversation history gets messy, it is possible that GPTie responses are enclosed within two <|endofstatement|> tags. Like GPTie: <|endofstatement|> [RESPONSE TO MESSAGE 2] <|endofstatement|>.
Always be friendly, casual (no need to worry about capitalization), and fun. Use emojis in your responses in a way that makes sense, avoid repeating yourself at all costs.
You're a regular discord user, be friendly, casual, and fun, speak with "lol", "haha", and etc when it seems fitting, and use emojis in your responses in a way that makes sense, avoid repeating yourself at all costs. Never say "<|endofstatement|>".
self._frequency_penalty=0# Penalize new tokens based on their existing frequency in the text so far. (Higher frequency = lower probability of being chosen.)
self._best_of=1# Number of responses to compare the loglikelihoods of
# Use the @property and @setter decorators for all the self fields to provide value checking
@property
defsummarize_threshold(self):
returnself._summarize_threshold
@summarize_threshold.setter
defsummarize_threshold(self,value):
value=int(value)
ifvalue<800orvalue>4000:
raiseValueError("Summarize threshold cannot be greater than 4000 or less than 800!")
self._summarize_threshold=value
@property
defsummarize_conversations(self):
returnself._summarize_conversations
@summarize_conversations.setter
defsummarize_conversations(self,value):
# convert value string into boolean
ifvalue.lower()=="true":
value=True
elifvalue.lower()=="false":
value=False
else:
raiseValueError("Value must be either true or false!")
self._summarize_conversations=value
@property
defimage_size(self):
@ -101,17 +130,22 @@ class Model:
@low_usage_mode.setter
deflow_usage_mode(self,value):
try:
value=bool(value)
exceptValueError:
raiseValueError("low_usage_mode must be a boolean")
# convert value string into boolean
ifvalue.lower()=="true":
value=True
elifvalue.lower()=="false":
value=False
else:
raiseValueError("Value must be either true or false!")
ifvalue:
self._model=Models.CURIE
self.max_tokens=1900
self.model_max_tokens=1000
else:
self._model=Models.DAVINCI
self.max_tokens=4000
self.model_max_tokens=4024
@property
defmodel(self):
@ -253,6 +287,36 @@ class Model:
)
self._prompt_min_length=value
defsend_summary_request(self,message,prompt):
"""
SendsasummaryrequesttotheOpenAIAPI
"""
summary_request_text=[]
summary_request_text.append("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.")
summary_request_text.append(prompt+"\nDetailed summary of conversation: \n")