Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent duplicate files for assistants #809

Open
SmittieC opened this issue Oct 31, 2024 · 0 comments
Open

Prevent duplicate files for assistants #809

SmittieC opened this issue Oct 31, 2024 · 0 comments

Comments

@SmittieC
Copy link
Collaborator

Duplicate files can be created in OCS when you do this:

  1. Create an assistant
  2. On OpenAI, upload a file to the assistant and sync the assistant with OCS
  3. Create a second assistant
  4. Attach the same vector store (using OpenAI's dashboard) to the second assistant and sync this one with OCS

This will create duplicate files in OCS, since we assume that there aren't other assistants using that vector store.

Here's a potential solution. Basically, we let the ToolResource point to the files linked to the other assistant's ToolResource, since the vector stores match. We'll need to redo the implementation of _sync_tool_resource_files_from_openai though, since that will start to delete files if one of the assistants now uses a new vector store. We need to check if the files are being used by another tool resource and only delete them when they are 1. only used by the current tool resource and 2. Not in the new list of file ids that we got from OpenAI.

That said, do we want to continue support for files that was created at OpenAI? I think Brian once mentioned that it's sometimes more convenient to create the assistant at OpenAI and play around with it there before importing it to OCS.
cc @bderenzi @snopoke @stephherbers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant