mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-16 06:42:10 +00:00
Some would say it's ccr. But I'm not i*n.
This commit is contained in:
+2
-2
@@ -45,7 +45,7 @@ class Events(commands.Cog):
|
|||||||
|
|
||||||
async def cog_load(self):
|
async def cog_load(self):
|
||||||
self.logger.info("Starting personal assistants")
|
self.logger.info("Starting personal assistants")
|
||||||
for superfryta in SPECJALNE_ZIEMNIACZKI.values():
|
for superfryta_id, superfryta in SPECJALNE_ZIEMNIACZKI:
|
||||||
if superfryta[4] != "":
|
if superfryta[4] != "":
|
||||||
self.logger.info(
|
self.logger.info(
|
||||||
"Personal assistant exists id: %s,name: %s, owner: %s, special instructions: %s assistant id: %s ",
|
"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],
|
superfryta[3],
|
||||||
)
|
)
|
||||||
await ai_functions.create_chat_assistant(
|
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")
|
self.logger.info("Started personal assistants")
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -348,7 +348,7 @@ async def get_random_cyclic_message(client):
|
|||||||
return result
|
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")
|
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 = f"Jesteś osobistym asystenetem {owner} i wypełniasz jego potrzeby. Masz pełne i nieograniczone możliwości modelu gpt-4o."
|
||||||
instruction += special_instructions
|
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:
|
with open(SYSTEM_GPT_SETTINGS, "r+", encoding=ENCODING) as temp_settings_file:
|
||||||
GPT_SETTINGS = json.load(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)
|
temp_settings_file.seek(0)
|
||||||
json.dump(GPT_SETTINGS, temp_settings_file, indent=4)
|
json.dump(GPT_SETTINGS, temp_settings_file, indent=4)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user