further minimalize openers and the minimal pretext

Kaveen Kumarasinghe 1 year ago
parent 5841171106
commit 42f5b1ea45

@ -412,6 +412,38 @@ class Commands(discord.Cog, name="Commands"):
required=False,
default=False,
)
@discord.option(
name="temperature",
description="Higher values means the model will take more risks",
required=False,
input_type=float,
min_value=0,
max_value=2,
)
@discord.option(
name="top_p",
description="1 is greedy sampling, 0.1 means only top 10%",
required=False,
input_type=float,
min_value=0,
max_value=1,
)
@discord.option(
name="frequency_penalty",
description="Decreasing the model's likelihood to repeat the same line verbatim",
required=False,
input_type=float,
min_value=-2,
max_value=2,
)
@discord.option(
name="presence_penalty",
description="Increasing the model's likelihood to talk about new topics",
required=False,
input_type=float,
min_value=-2,
max_value=2,
)
@discord.guild_only()
async def converse(
self,
@ -420,9 +452,13 @@ class Commands(discord.Cog, name="Commands"):
opener_file: str,
private: bool,
minimal: bool,
temperature: float,
top_p: float,
frequency_penalty: float,
presence_penalty: float,
):
await self.converser_cog.converse_command(
ctx, opener, opener_file, private, minimal
ctx, opener, opener_file, private, minimal, temperature, top_p, frequency_penalty, presence_penalty
)
@add_to_group("gpt")

@ -798,6 +798,10 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"):
opener_file: str,
private: bool,
minimal: bool,
temperature: float,
top_p: float,
frequency_penalty: float,
presence_penalty: float,
):
"""Command handler. Starts a conversation with the bot
@ -807,6 +811,10 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"):
opener_file (str): A .txt or .json file which is appended before the opener
private (bool): If the thread should be private
minimal (bool): If a minimal starter should be used
temperature (float): Sets the temperature override
top_p (float): Sets the top p override
frequency_penalty (float): Sets the frequency penalty override
presence_penalty (float): Sets the presence penalty override
"""
user = ctx.user
@ -857,6 +865,11 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"):
self.conversation_threads[thread.id] = Thread(thread.id)
self.conversation_threads[thread.id].model = self.model.model
# Set the overrides for the conversation
self.conversation_threads[thread.id].set_overrides(
temperature, top_p, frequency_penalty, presence_penalty
)
if opener:
opener = await self.mention_to_username(ctx, opener)
@ -910,7 +923,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"):
opener_file = None # Just start a regular thread if the file fails to load
# Append the starter text for gpt3 to the user's history so it gets concatenated with the prompt later
if minimal or opener_file:
if minimal or opener_file or opener:
self.conversation_threads[thread.id].history.append(
EmbeddedConversationItem(self.CONVERSATION_STARTER_TEXT_MINIMAL, 0)
)

@ -1,6 +1,4 @@
Instructions for you:
You are an all-intelligent assistant. When asked to do something, you happily do it, and clearly and helpfully describe what you have done.
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:
<username>: [MESSAGE 1] <|endofstatement|>
@ -11,6 +9,3 @@ The conversations are in this format, there can be an arbitrary amount of newlin
<yourname> will be given to you in an actual conversation.
...
Never say "<|endofstatement|>". Never say <yourname> or <username> in your response either. Never respond as or pretend to be the user, only respond as yourself.
You're a regular discord user, be friendly, casual, and fun, speak with "lol", "haha", and other slang when it seems fitting, and use emojis in your responses in a way that makes sense.

Loading…
Cancel
Save