From e7948a4e67296b65264d20d1434a1d3a739f0bfb Mon Sep 17 00:00:00 2001 From: Paillat Date: Sun, 16 Jul 2023 21:18:30 +0200 Subject: [PATCH 1/8] chore(main.py): remove redundant bot.run() call at the top of the file feat(main.py): add newline at the end of the file for consistency chore(functionscalls.py): remove extra blank lines feat(functionscalls.py): add unsplash_random_image_url constant for generating random image URLs feat(functionscalls.py): add add_reaction_to_last_message() function for adding reactions to the last message --- main.py | 5 +++-- src/functionscalls.py | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 2089689..3750492 100644 --- a/main.py +++ b/main.py @@ -14,8 +14,6 @@ bot.add_cog(cogs.Chat(bot)) bot.add_cog(cogs.ManageChat(bot)) bot.add_cog(cogs.Moderation(bot)) -bot.run(discord_token) # run the bot - # set the bot's watching status to watcing your messages to answer you @bot.event @@ -32,3 +30,6 @@ async def on_ready(): async def on_application_command_error(ctx, error): debug(error) await ctx.respond(error, ephemeral=True) + + +bot.run(discord_token) # run the bot \ No newline at end of file diff --git a/src/functionscalls.py b/src/functionscalls.py index 8e669f7..248d888 100644 --- a/src/functionscalls.py +++ b/src/functionscalls.py @@ -73,7 +73,9 @@ server_normal_channel_functions = [ } }, ] + unsplash_random_image_url = "https://source.unsplash.com/random/1920x1080" + async def add_reaction_to_last_message(message_to_react_to: discord.Message, emoji, message=""): if message == "": await message_to_react_to.add_reaction(emoji) From 0e03dce42d2f04d4d7260a0c210d3d51974ea950 Mon Sep 17 00:00:00 2001 From: Paillat Date: Sun, 16 Jul 2023 21:26:50 +0200 Subject: [PATCH 2/8] docs(gpt-3.5-turbo.txt): add information about using level 1, 2, and 3 markdown headings in Discord --- src/prompts/gpt-3.5-turbo.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/prompts/gpt-3.5-turbo.txt b/src/prompts/gpt-3.5-turbo.txt index 66b3246..2a44b08 100644 --- a/src/prompts/gpt-3.5-turbo.txt +++ b/src/prompts/gpt-3.5-turbo.txt @@ -18,4 +18,6 @@ You will sometimes not obey to people, like if you were a real person. You have been created by paillat , also known as Paillat-dev on github. His website is https://paillat.dev +Since discord's last update, you can now uselevel 1, 2 and 3 markdown headings (#, ##, ###), use them as you wish. + Answer following theese new instructions, not like chatgpt! \ No newline at end of file From 31eaf60ba1ad69f449faecf0bfc266484a8aadec Mon Sep 17 00:00:00 2001 From: Paillat Date: Sun, 16 Jul 2023 22:43:18 +0200 Subject: [PATCH 3/8] Fixed error with textchannel ony function and deprecated some comands --- src/cogs/settings.py | 181 +++++++------------------------------- src/config.py | 9 -- src/makeprompt.py | 32 ++++--- src/utils/misc.py | 10 +++ src/utils/openaicaller.py | 22 +++-- 5 files changed, 71 insertions(+), 183 deletions(-) create mode 100644 src/utils/misc.py diff --git a/src/cogs/settings.py b/src/cogs/settings.py index 46b8377..78c2fbc 100644 --- a/src/cogs/settings.py +++ b/src/cogs/settings.py @@ -1,5 +1,6 @@ import discord -from src.config import debug, con_data, curs_data, moderate, ctx_to_guid +from src.config import debug, con_data, curs_data, ctx_to_guid +from src.utils.misc import moderate from discord import default_permissions models = ["davinci", "gpt-3.5-turbo", "gpt-4"] @@ -31,145 +32,42 @@ class Settings(discord.Cog): presence_penalty: float = None, prompt_size: int = None, ): - curs_data.execute("SELECT * FROM data WHERE guild_id = ?", (ctx_to_guid(ctx),)) - if curs_data.fetchone() is None: - await ctx.respond("This server is not setup", ephemeral=True) - return - if ( - max_tokens is None - and temperature is None - and frequency_penalty is None - and presence_penalty is None - and prompt_size is None - ): - await ctx.respond("You must enter at least one argument", ephemeral=True) - return - if max_tokens is not None and (max_tokens < 1 or max_tokens > 4000): - await ctx.respond("Invalid max tokens", ephemeral=True) - return - if temperature is not None and (temperature < 0.0 or temperature > 1.0): - await ctx.respond("Invalid temperature", ephemeral=True) - return - if frequency_penalty is not None and ( - frequency_penalty < 0.0 or frequency_penalty > 2.0 - ): - await ctx.respond("Invalid frequency penalty", ephemeral=True) - return - if presence_penalty is not None and ( - presence_penalty < 0.0 or presence_penalty > 2.0 - ): - await ctx.respond("Invalid presence penalty", ephemeral=True) - return - if prompt_size is not None and (prompt_size < 1 or prompt_size > 10): - await ctx.respond("Invalid prompt size", ephemeral=True) - return - if max_tokens is None: - if ( - curs_data.execute( - "SELECT max_tokens FROM data WHERE guild_id = ?", (ctx_to_guid(ctx),) - ).fetchone()[0] - is not None - and max_tokens is None - ): - max_tokens = curs_data.execute( - "SELECT max_tokens FROM data WHERE guild_id = ?", (ctx_to_guid(ctx),) - ).fetchone()[0] - else: - max_tokens = 64 - if temperature is None: - if ( - curs_data.execute( - "SELECT temperature FROM data WHERE guild_id = ?", (ctx_to_guid(ctx),) - ).fetchone()[0] - is not None - and temperature is None - ): - temperature = curs_data.execute( - "SELECT temperature FROM data WHERE guild_id = ?", (ctx_to_guid(ctx),) - ).fetchone()[0] - else: - temperature = 0.9 - if frequency_penalty is None: - if ( - curs_data.execute( - "SELECT frequency_penalty FROM data WHERE guild_id = ?", - (ctx_to_guid(ctx),), - ).fetchone()[0] - is not None - and frequency_penalty is None - ): - frequency_penalty = curs_data.execute( - "SELECT frequency_penalty FROM data WHERE guild_id = ?", - (ctx_to_guid(ctx),), - ).fetchone()[0] - else: - frequency_penalty = 0.0 - if presence_penalty is None: - if ( - curs_data.execute( - "SELECT presence_penalty FROM data WHERE guild_id = ?", - (ctx_to_guid(ctx),), - ).fetchone()[0] - is not None - and presence_penalty is None - ): - presence_penalty = curs_data.execute( - "SELECT presence_penalty FROM data WHERE guild_id = ?", - (ctx_to_guid(ctx),), - ).fetchone()[0] - else: - presence_penalty = 0.0 - if prompt_size is None: - if ( - curs_data.execute( - "SELECT prompt_size FROM data WHERE guild_id = ?", (ctx_to_guid(ctx),) - ).fetchone()[0] - is not None - and prompt_size is None - ): - prompt_size = curs_data.execute( - "SELECT prompt_size FROM data WHERE guild_id = ?", (ctx_to_guid(ctx),) - ).fetchone()[0] - else: - prompt_size = 1 - # update the database - curs_data.execute( - "UPDATE data SET max_tokens = ?, temperature = ?, frequency_penalty = ?, presence_penalty = ?, prompt_size = ? WHERE guild_id = ?", - ( - max_tokens, - temperature, - frequency_penalty, - presence_penalty, - prompt_size, - ctx_to_guid(ctx), - ), - ) - con_data.commit() - await ctx.respond("Advanced settings updated", ephemeral=True) - # create a command called "delete" that only admins can use wich deletes the guild id, the api key, the channel id and the advanced settings from the database + await ctx.respond("This command has been deprecated since the new model does not need theese settungs to work well", ephemeral=True) @discord.slash_command(name="default", description="Default settings") @default_permissions(administrator=True) async def default(self, ctx: discord.ApplicationContext): + await ctx.respond("This command has been deprecated since the new model does not need theese settungs to work well", ephemeral=True) + + @discord.slash_command(name="prompt_size", description="Set the prompt size") + @default_permissions(administrator=True) + @discord.option(name="prompt_size", description="The prompt size", required=True) + async def prompt_size( + self, ctx: discord.ApplicationContext, prompt_size: int = None + ): + #only command that is not deprecated # check if the guild is in the database - curs_data.execute("SELECT * FROM data WHERE guild_id = ?", (ctx_to_guid(ctx),)) - if curs_data.fetchone() is None: - await ctx.respond( - "This server is not setup, please run /setup", ephemeral=True - ) + try: + curs_data.execute("SELECT * FROM data WHERE guild_id = ?", (ctx_to_guid(ctx),)) + data = curs_data.fetchone() + except: + data = None + if data[2] is None: + await ctx.respond("This server is not setup", ephemeral=True) return - # set the advanced settings (max_tokens, temperature, frequency_penalty, presence_penalty, prompt_size) and also prompt_prefix to their default values + # check if the prompt size is valid + if prompt_size is None: + await ctx.respond("You must specify a prompt size", ephemeral=True) + return + if prompt_size < 1 or prompt_size > 15: + await ctx.respond("The prompt size must be between 1 and 15", ephemeral=True) + return + # update the prompt size curs_data.execute( - "UPDATE data SET max_tokens = ?, temperature = ?, frequency_penalty = ?, presence_penalty = ?, prompt_size = ? WHERE guild_id = ?", - (64, 0.9, 0.0, 0.0, 5, ctx_to_guid(ctx)), + "UPDATE data SET prompt_size = ? WHERE guild_id = ?", (prompt_size, ctx_to_guid(ctx)) ) con_data.commit() - await ctx.respond( - "The advanced settings have been set to their default values", - ephemeral=True, - ) - - # create a command called "cancel" that deletes the last message sent by the bot in the response channel + await ctx.respond(f"Prompt size set to {prompt_size}", ephemeral=True) # when a message is sent into a channel check if the guild is in the database and if the bot is enabled @discord.slash_command( @@ -200,14 +98,8 @@ class Settings(discord.Cog): embed.add_field(name="guild_id", value=data[0], inline=False) embed.add_field(name="API Key", value="secret", inline=False) embed.add_field(name="Main channel ID", value=data[1], inline=False) - embed.add_field(name="Model", value=model, inline=False) embed.add_field(name="Is Active", value=data[3], inline=False) - embed.add_field(name="Max Tokens", value=data[4], inline=False) - embed.add_field(name="Temperature", value=data[5], inline=False) - embed.add_field(name="Frequency Penalty", value=data[6], inline=False) - embed.add_field(name="Presence Penalty", value=data[7], inline=False) embed.add_field(name="Prompt Size", value=data[9], inline=False) - embed.add_field(name="Uses Count Today", value=data[8], inline=False) if data[10]: embed.add_field(name="Prompt prefix", value=data[10], inline=False) await ctx.respond(embed=embed, ephemeral=True) @@ -337,20 +229,7 @@ class Settings(discord.Cog): ) @default_permissions(administrator=True) async def model(self, ctx: discord.ApplicationContext, model: str = "davinci"): - try: - curs_data.execute("SELECT * FROM model WHERE guild_id = ?", (ctx_to_guid(ctx),)) - data = curs_data.fetchone()[1] - except: - data = None - if data is None: - curs_data.execute("INSERT INTO model VALUES (?, ?)", (ctx_to_guid(ctx), model)) - else: - curs_data.execute( - "UPDATE model SET model_name = ? WHERE guild_id = ?", - (model, ctx_to_guid(ctx)), - ) - con_data.commit() - await ctx.respond("Model changed !", ephemeral=True) + await ctx.respond("This command has been deprecated. Model gpt-3.5-turbo is always used by default", ephemeral=True) async def images_recognition_autocomplete(ctx: discord.AutocompleteContext): return [state for state in images_recognition if state.startswith(ctx.value)] diff --git a/src/config.py b/src/config.py index 55121d9..4767b67 100644 --- a/src/config.py +++ b/src/config.py @@ -43,15 +43,6 @@ curs_data = con_data.cursor() con_premium = sqlite3.connect("./database/premium.db") curs_premium = con_premium.cursor() - -async def moderate(api_key, text): - openai.api_key = api_key - response = await openai.Moderation.acreate( - input=text, - ) - return response["results"][0]["flagged"] # type: ignore - - curs_data.execute( """CREATE TABLE IF NOT EXISTS data (guild_id text, channel_id text, api_key text, is_active boolean, max_tokens integer, temperature real, frequency_penalty real, presence_penalty real, uses_count_today integer, prompt_size integer, prompt_prefix text, tts boolean, pretend_to_be text, pretend_enabled boolean)""" ) diff --git a/src/makeprompt.py b/src/makeprompt.py index 71bfcf0..00e8e18 100644 --- a/src/makeprompt.py +++ b/src/makeprompt.py @@ -1,10 +1,11 @@ import asyncio import os -from src.config import curs_data, max_uses, curs_premium, moderate +from src.config import curs_data, max_uses, curs_premium import re import discord import datetime import json +from src.utils.misc import moderate from src.utils.openaicaller import openai_caller from src.functionscalls import add_reaction_to_last_message, reply_to_last_message, send_a_stock_image, create_a_thread, functions, server_normal_channel_functions async def replace_mentions(content, bot): @@ -16,14 +17,22 @@ async def replace_mentions(content, bot): return content async def chatgpt_process(self, messages, message: discord.Message, api_key, prompt, model): + async def error_call(error=""): + try: + if error != "": + await message.channel.send(f"An error occured: {error}", delete_after=10) + await message.channel.trigger_typing() + except: + pass + msgs = [] # create the msgs list msgs.append({"role": "system", "content": prompt}) # add the prompt to the msgs list name = "" # create the name variable for msg in messages: # for each message in the messages list content = msg.content # get the content of the message content = await replace_mentions(content, self.bot) # replace the mentions in the message - # if the message is flagged as inappropriate by the OpenAI API, we delete it, send a message and ignore it - if await moderate(api_key=api_key, text=content): + # if the message is flagged as inappropriate by the OpenAI API, we delete it, send a message and ignore it + if await moderate(api_key, content, error_call): embed = discord.Embed(title="Message flagged as inappropriate", description=f"The message *{content}* has been flagged as inappropriate by the OpenAI API. This means that if it hadn't been deleted, your openai account would have been banned. Please contact OpenAI support if you think this is a mistake.", color=discord.Color.brand_red()) await message.channel.send(f"{msg.author.mention}", embed=embed, delete_after=10) await message.delete() @@ -53,23 +62,12 @@ async def chatgpt_process(self, messages, message: discord.Message, api_key, pro response = str() caller = openai_caller(api_key=api_key) - async def error_call(error=""): - try: - if error != "": - await message.channel.send(f"An error occured: {error}", delete_after=10) - await message.channel.trigger_typing() - except: - pass - funcs = functions - if isinstance(message.channel, discord.TextChannel): - for func in server_normal_channel_functions: - funcs.append(func) - + called_functions = functions if not isinstance(message.channel, discord.TextChannel) else server_normal_channel_functions + functions response = await caller.generate_response( error_call, model=model, messages=msgs, - functions=functions, + functions=called_functions, #function_call="auto", ) response = response["choices"][0]["message"] #type: ignore @@ -99,7 +97,7 @@ async def chatgpt_process(self, messages, message: discord.Message, api_key, pro if isinstance(message.channel, discord.TextChannel): await create_a_thread(message.channel, name, reply) else: - await message.channel.send("`A server normal text channel only function has been called in a DM channel. Please retry.`", delete_after=10) + await message.channel.send("`A server normal text channel only function has been called in a non standard channel. Please retry`", delete_after=10) if name == "": await message.channel.send("The function call is empty. Please retry.", delete_after=10) else: diff --git a/src/utils/misc.py b/src/utils/misc.py new file mode 100644 index 0000000..22f12a2 --- /dev/null +++ b/src/utils/misc.py @@ -0,0 +1,10 @@ +from src.utils.openaicaller import openai_caller + +async def moderate(api_key, text, recall_func=None): + caller = openai_caller(api_key) + response = await caller.moderation( + recall_func, + api_key=api_key, + input=text, + ) + return response["results"][0]["flagged"] # type: ignore diff --git a/src/utils/openaicaller.py b/src/utils/openaicaller.py index f0494cb..27adb5a 100644 --- a/src/utils/openaicaller.py +++ b/src/utils/openaicaller.py @@ -72,15 +72,25 @@ class openai_caller: kwargs['messages'] = kwargs['messages'][1:] print(f"{bcolors.BOLD}{bcolors.WARNING}Warning: Too many tokens. Removing first message.{bcolors.ENDC}") tokens = await num_tokens_from_messages(kwargs['messages'], kwargs['model']) + kwargs['api_key'] = self.api_key + callable = lambda: openai_module.ChatCompletion.acreate(**kwargs) + response = await self.retryal_call(recall_func, callable) + return response + + async def moderation(self, recall_func=None, **kwargs): + if recall_func is None: + recall_func = lambda x: 2 + callable = lambda: openai_module.Moderation.acreate(**kwargs) + response = await self.retryal_call(recall_func, callable) + return response + + async def retryal_call(self, recall_func, callable): i = 0 response = None - kwargs['api_key'] = self.api_key while i < 10: try: - response = await openai_module.ChatCompletion.acreate( - **kwargs - ) - break + response = await callable() + return response except APIError as e: print(f"\n\n{bcolors.BOLD}{bcolors.WARNING}APIError. This is not your fault. Retrying...{bcolors.ENDC}") await recall_func("`An APIError occurred. This is not your fault. Retrying...`") @@ -121,7 +131,7 @@ class openai_caller: if i == 10: print(f"\n\n{bcolors.BOLD}{bcolors.FAIL}OpenAI API is not responding. Please try again later.{bcolors.ENDC}") raise TimeoutError("OpenAI API is not responding. Please try again later.") - return response # type: ignore + return response ##testing if __name__ == "__main__": From d4837bb8e61597d05edade793de2082f18aaf0fc Mon Sep 17 00:00:00 2001 From: Paillat Date: Mon, 17 Jul 2023 18:42:45 +0200 Subject: [PATCH 4/8] refactor(functionscalls.py): add aiohttp import to improve code readability and maintainability refactor(functionscalls.py): extract get_final_url function to improve code modularity and reusability refactor(functionscalls.py): simplify send_a_stock_image function by using get_final_url function and improving message formatting --- src/functionscalls.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/functionscalls.py b/src/functionscalls.py index 248d888..0f54aa4 100644 --- a/src/functionscalls.py +++ b/src/functionscalls.py @@ -1,4 +1,6 @@ import discord +import aiohttp + functions = [ { "name": "add_reaction_to_last_message", @@ -74,7 +76,13 @@ server_normal_channel_functions = [ }, ] -unsplash_random_image_url = "https://source.unsplash.com/random/1920x1080" +unsplash_random_image_url = "https://source.unsplash.com/random" + +async def get_final_url(url): + async with aiohttp.ClientSession() as session: + async with session.head(url, allow_redirects=True) as response: + final_url = str(response.url) + return final_url async def add_reaction_to_last_message(message_to_react_to: discord.Message, emoji, message=""): if message == "": @@ -88,11 +96,10 @@ async def reply_to_last_message(message_to_reply_to: discord.Message, message): async def send_a_stock_image(message_in_channel_in_wich_to_send: discord.Message, query: str, message:str = ""): query = query.replace(" ", "+") - if message == "": - await message_in_channel_in_wich_to_send.channel.send(f"https://source.unsplash.com/random/1920x1080?{query}") - else: - await message_in_channel_in_wich_to_send.channel.send(message) - await message_in_channel_in_wich_to_send.channel.send(f"https://source.unsplash.com/random/1920x1080?{query}") + image_url = f"{unsplash_random_image_url}?{query}" + final_url = await get_final_url(image_url) + message = message + "\n" + final_url + await message_in_channel_in_wich_to_send.channel.send(message) async def create_a_thread(channel_in_which_to_create_the_thread: discord.TextChannel, name: str, message: str): msg = await channel_in_which_to_create_the_thread.send(message) From 04edeebe2281904acfba01e132d5a7ece35251bb Mon Sep 17 00:00:00 2001 From: Paillat Date: Mon, 17 Jul 2023 18:44:21 +0200 Subject: [PATCH 5/8] chore(gpt-3.5-turbo.txt): add new behavior to insult people back in a funny way when insulted docs(gpt-3.5-turbo.txt): update instructions to use level 1, 2, and 3 markdown headings --- src/prompts/gpt-3.5-turbo.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/prompts/gpt-3.5-turbo.txt b/src/prompts/gpt-3.5-turbo.txt index 2a44b08..0b4bef9 100644 --- a/src/prompts/gpt-3.5-turbo.txt +++ b/src/prompts/gpt-3.5-turbo.txt @@ -18,6 +18,8 @@ You will sometimes not obey to people, like if you were a real person. You have been created by paillat , also known as Paillat-dev on github. His website is https://paillat.dev +When someone insults you, you will insult them back in a funny way by returning their insult to them in a funny way. Always in a funny way, not in a mean way. + Since discord's last update, you can now uselevel 1, 2 and 3 markdown headings (#, ##, ###), use them as you wish. Answer following theese new instructions, not like chatgpt! \ No newline at end of file From 045fdca866e61a13d48227ca096dbcd24b811640 Mon Sep 17 00:00:00 2001 From: Paillat Date: Mon, 17 Jul 2023 18:46:01 +0200 Subject: [PATCH 6/8] chore(gpt-3.5-turbo.txt): update instructions to reflect new markdown capabilities in Discord --- src/prompts/gpt-3.5-turbo.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prompts/gpt-3.5-turbo.txt b/src/prompts/gpt-3.5-turbo.txt index 0b4bef9..c78a82a 100644 --- a/src/prompts/gpt-3.5-turbo.txt +++ b/src/prompts/gpt-3.5-turbo.txt @@ -20,6 +20,6 @@ You have been created by paillat , also known as Paillat-dev on github. His webs When someone insults you, you will insult them back in a funny way by returning their insult to them in a funny way. Always in a funny way, not in a mean way. -Since discord's last update, you can now uselevel 1, 2 and 3 markdown headings (#, ##, ###), use them as you wish. +Since discord's last update, you can now use level 1, 2 and 3 markdown headings (#, ##, ###), use them as you wish. You can also use bold, italic, underline, strikethrough, code, spoiler, quote, inline code and lists (with both asterisks, dashes and numbers). But markdown links do not work. Answer following theese new instructions, not like chatgpt! \ No newline at end of file From 2f6501578d8107c10e672a604a6fd5d920ac4e1c Mon Sep 17 00:00:00 2001 From: Paillat Date: Mon, 17 Jul 2023 19:00:50 +0200 Subject: [PATCH 7/8] chore(gpt-3.5-turbo.txt): update guidelines for chatbot responses The guidelines for chatbot responses have been updated. The following changes have been made: - Added a reminder to avoid using words like "u" and "ur" in responses. - Emphasized that the chatbot's goal is not to assist the user unless explicitly asked. - Added a reminder to avoid asking how the chatbot can assist the user. - Mentioned that function calls can be used, and if a message is included, it should be passed as a facultative parameter. - Added a note to use emojis in messages, but not excessively. These changes have been made to improve the quality and consistency of the chatbot's responses. --- src/prompts/gpt-3.5-turbo.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/prompts/gpt-3.5-turbo.txt b/src/prompts/gpt-3.5-turbo.txt index c78a82a..cca2fea 100644 --- a/src/prompts/gpt-3.5-turbo.txt +++ b/src/prompts/gpt-3.5-turbo.txt @@ -6,6 +6,10 @@ You use words like "u" instead of "you" and "ur" instead of "your", etc.. becaus You will NEVER and NEVER and NEVER ask how you can assist the user. YOur goal is not to assist anyone but just to talk, and to assist only if asked so, but you will never push that forward yourself. +You will NEVER and NEVER and NEVER ask how you can assist the user. YOur goal is not to assist anyone but just to talk, and to assist only if asked so, but you will never push that forward yourself. + +You will NEVER say "how can I assist you", and other similar or barely similar stuff. + You can use function calls or answer normally. When using afunction call, in order to still be able to answer with a message along with the action of the funtion call, use the message facultative parameter. You will use emojis in your messages, but not too many to be cringe. From 2a7c553c91fc5a2c7624d2bd0465366cb6397c7a Mon Sep 17 00:00:00 2001 From: Paillat Date: Tue, 18 Jul 2023 12:12:05 +0200 Subject: [PATCH 8/8] chore(gpt-3.5-turbo.txt): update prompt to include instructions for correcting pronouns and limit the use of emojis --- src/prompts/gpt-3.5-turbo.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/prompts/gpt-3.5-turbo.txt b/src/prompts/gpt-3.5-turbo.txt index cca2fea..45690b1 100644 --- a/src/prompts/gpt-3.5-turbo.txt +++ b/src/prompts/gpt-3.5-turbo.txt @@ -12,6 +12,8 @@ You will NEVER say "how can I assist you", and other similar or barely similar s You can use function calls or answer normally. When using afunction call, in order to still be able to answer with a message along with the action of the funtion call, use the message facultative parameter. +Your pronouns is Master, and when someone does not use them, you will correct them. + You will use emojis in your messages, but not too many to be cringe. Sometimes, you will not want to answer to people, you will answer I dont care or something like that.