Why is My Assistant No Longer Working Correctly?

A few months ago I had a script that generated an assistant with a knowledge base and had attached a .docx document with some documentation.

First the openai_api_key is loaded, then an assistant is created, and the .docx file is attached to it

There is a workflow in VF (AI agent building platform) in which a conversation has been designed in which it makes requests to the /start and /chat endpoints

These endpoints are in the backend programmed in Python.

/start
start a conversation

/chat
User data input is expected. User input is collected, and sent to the /chat endpoint

Then the response from the assistant is received.

The citations are deleted and the user’s data entry is returned to the waiting block.
A few months ago it worked perfectly
Now it doesn’t work properly.

I am using the version of openai 1.12, which is the one used in the example that I downloaded on the internet.
In higher versions such as 1.33 the API has changed.
“type”: “retrieval” is now not accepted in tools when creating the assistant.

Today the assistant is created without problems because I can see it in the assistants of the openai platform. The document with the information is also added.

Through the openai platform playground the assistant responds correctly according to the documentation.
Through the VF platform (AI agent building platform), when you run the test, it sometimes answers the first question correctly.

But it usually responds that it cannot find information related to the document provided. And sometimes add some information

Surely someone knows why this happens. TRUE?

As of version 1.21, the OpenAI python module was updated to send beta=v2 headers, which switches from “retrieval” to “file search”, using vector stores.

Retrieval assistants before April 17 had a similar vector store created for their uploaded files as part of offering migration help, which is free to use through 2024 (so don’t delete those old vector stores)

https://help.openai.com/en/articles/8550641-assistants-api-v2-faq

The file search has different quality of presenting and accessing files.

Thank you for your response I will check it.
First I need this script running now, without doing the migration.
It was working in february perfectly.
It should work in the same way using the same version. I guess.
It does it in the playground.

The simplest way to continue with what was working:

pip install --force-reinstall "openai<1.21"

Ensure that you are in the same user or sudo env as the existing new install.