AttributeError: 'Beta' object has no attribute 'vector_stores'

I’m trying to use the new v2 assistants api.

Early in my python program, I create a client as usual:
client = OpenAI(api_key=‘xxxxxx’)

Later I try to use the client to create a vector_store:
vector_store = client.beta.vector_stores.create(name=“Deposition”)

But I get the following error every time:
AttributeError: ‘Beta’ object has no attribute ‘vector_stores’

I have the very latest python sdk installed (1.21.2). I have tried uninstalling it and reinstalling it, which didn’t help. I have rebooted my computer and cleared out all caches and tried again. No joy.

What am I missing?

I’m wondering if this is a bug, or some problem on my end. Has anyone else been able to call “vector_store = client.beta.vector_stores.create(name=‘YourName’)” without getting this error?

Hello,

Have you tried this command?

pip install --upgrade openai

That did it for me :slight_smile:

Cheers,
Ben

2 Likes

I did. Thank you, but it didn’t help me. I’ll try again, though.

Hmm, sorry I can’t help more. I had the same error and the command above solved it for me after trying a few different things. Hope you figure it out!

Thanks Ben. On further investigation, the problem seems to be some conflict with streamlit (I am building streamlit app). When I created a test project without streamlit, the vector_store created just fine.

Layne

1 Like

The same dependency error for me. We had to rewrite some internal tooling to accommodate assistants-api v1 features.

Works with openai==1.30.3 now.