This commit is contained in:
2024-11-15 01:08:34 +01:00
parent a72dba291b
commit 22730776d4
2 changed files with 2 additions and 3 deletions
-1
View File
@@ -21,7 +21,6 @@ from constants import (
WORD_REACTIONS, WORD_REACTIONS,
) )
DM_MODE = "assistant" DM_MODE = "assistant"
class Events(commands.Cog): class Events(commands.Cog):
def __init__(self, bot): def __init__(self, bot):
self.bot = bot self.bot = bot
+2 -2
View File
@@ -320,12 +320,12 @@ async def chat_with_assistant(message, assistant_name):
logger = logging.getLogger("discord") logger = logging.getLogger("discord")
assistant_data = ASSISTANTS[assistant_name] assistant_data = ASSISTANTS[assistant_name]
ai_message = await OPENAICLIENT.beta.threads.messages.create( ai_message = await OPENAICLIENT.beta.threads.messages.create(
thread_id=assistant_data[3], role="user", content=message.content thread_id=assistant_data[3].id, role="user", content=message.content
) )
logger.info(ai_message) logger.info(ai_message)
run = await OPENAICLIENT.beta.threads.runs.create_and_poll( run = await OPENAICLIENT.beta.threads.runs.create_and_poll(
thread_id=assistant_data[3].id, thread_id=assistant_data[3].id,
assistant_id=assistant_data[1].id, assistant_id=assistant_data[1],
instructions=f"Pisze do Ciebie {assistant_data[0]} udziel mu wszelkiej pomocy", instructions=f"Pisze do Ciebie {assistant_data[0]} udziel mu wszelkiej pomocy",
) )
done = False done = False