openai-python icon indicating copy to clipboard operation
openai-python copied to clipboard

trying to use my assistant; one run creates more than one run

Open dehhganii opened this issue 1 year ago • 0 comments

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • [X] This is an issue with the Python library

Describe the bug

with creating a thread: thread = client.beta.threads.create()

with creating the message: message = client.beta.threads.messages.create( thread_id=thread.id, role="role", content="message" )

and run using this command: run = client.beta.threads.runs.create_and_poll( thread_id=thread.id, assistant_id='assistant_id' )

Sometimes, when I see the chat in here https://platform.openai.com/threads/, one run causes multiple responses from the assistant. So, when I grab the latest message, it is not based on the initial message I sent.

I put all these three steps in one loop, of length around 100, and I saw this behavior in some of the threads.

To Reproduce

image

Code snippets

No response

OS

linux

Python version

3.10

Library version

openai v1.0.1

dehhganii avatar Sep 19 '24 16:09 dehhganii