#Assistant API usage problem. (Python)

1 messages · Page 1 of 1 (latest)

astral moat
#

Im having a pretty simple issue, wondering if someone can help.

I have python code using the openai module, and I'm attemping to use a pre-created assistant.
steps:
1.) assistant = client.beta.assistants.retrieve(ASSISTANT_ID) # i check the ID i have resolves
2.) thread = client.beta.threads.create() # I create a thread
3.) client.beta.threads.messages.create(thread_id=thread.id, role="user", content=prompt) # create a message
4.) run = client.beta.threads.runs.create_and_poll(thread_id=thread.id, assistant_id=assistant.id, instructions="Respond to user using precreated instructions")

However, the responses are nothing like playground. They are generic responses without any of the assistants instructions. Seems like its not using my assistant at all.
I may try to switch to stream instead of create_and_poll , but the behaviour is odd.