Never mind! I figured it out. I was passing in the user input through the “instructions” parameter. Instead I had to add the message to the thread before starting the run.
The corrected code looks like this:
def run_openai(self, thread_id, assistant_id, thread_user_message, instructions=None):
self.client.beta.threads.messages.create(
thread_id=thread_id,
role="user",
content=thread_user_message
)
run = self.client.beta.threads.runs.create(
thread_id=thread_id,
assistant_id=assistant_id,
instructions=instructions
)