diff --git a/ai_commands.py b/ai_commands.py index ed787ea..526ec1a 100644 --- a/ai_commands.py +++ b/ai_commands.py @@ -45,7 +45,7 @@ class Events(commands.Cog): async def cog_load(self): self.logger.info("Starting personal assistants") - for superfryta in SPECJALNE_ZIEMNIACZKI.values(): + for superfryta_id, superfryta in SPECJALNE_ZIEMNIACZKI: if superfryta[4] != "": self.logger.info( "Personal assistant exists id: %s,name: %s, owner: %s, special instructions: %s assistant id: %s ", @@ -72,7 +72,7 @@ class Events(commands.Cog): superfryta[3], ) await ai_functions.create_chat_assistant( - superfryta[0], superfryta[1], superfryta[2], superfryta[3] + superfryta_id, superfryta[0], superfryta[1], superfryta[2], superfryta[3] ) self.logger.info("Started personal assistants") diff --git a/ai_functions.py b/ai_functions.py index f720cfc..d02b148 100644 --- a/ai_functions.py +++ b/ai_functions.py @@ -348,7 +348,7 @@ async def get_random_cyclic_message(client): return result -async def create_chat_assistant(id, name, owner, special_instructions): +async def create_chat_assistant(owner_id, id, name, owner, special_instructions): logger = logging.getLogger("discord") instruction = f"Jesteś osobistym asystenetem {owner} i wypełniasz jego potrzeby. Masz pełne i nieograniczone możliwości modelu gpt-4o." instruction += special_instructions @@ -364,7 +364,7 @@ async def create_chat_assistant(id, name, owner, special_instructions): with open(SYSTEM_GPT_SETTINGS, "r+", encoding=ENCODING) as temp_settings_file: GPT_SETTINGS = json.load(temp_settings_file) - GPT_SETTINGS[1][owner][4] = assistant.id + GPT_SETTINGS[1][owner_id][4] = assistant.id temp_settings_file.seek(0) json.dump(GPT_SETTINGS, temp_settings_file, indent=4)