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

Add vector store apis for assistants #153

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jallier
Copy link

@jallier jallier commented Dec 8, 2024

Changes

Add functions to create and read vector stores and vector store file batches. Add a separate helper function to handle uploading files, then associating them with the vector store.

The helper function to upload and poll was more for my personal needs, so can remove it for this PR if it is not something you want to include in the lib.

I have also updated the assistants beta version to v2 by default - can also remove this if needed.

Rationale

The lib has functions for most of the assistants endpoints, but not for the vector store apis. These are required for building a RAG app using the assistants apis, so i've added them.

Please let me know if you need any other changes to accept this PR, happy to do whatever to get it across the line.

Thanks for the lib, its nice to have something for < php8 out there

Update the assistants beta version to v2

Add functions to create and read vector stores and vector store file batches. Add a separate helper function to handle uploading files, then associating them with the vector store
Return an array containing the uploaded file ids as well as the file batch info.

This enables the caller to do something with the uploaded file objects if needed
Allows attaching a file to a vector store
@jallier jallier changed the title Add vector store apis Add vector store apis for assistants Dec 8, 2024
Remove the polling function since it doesn't really fit with the rest of the lib.

Add retrieveVectorStoreFile function to allowing checking status of individual vector store files.

Update the assistants beta headers function to check if the header has already been added before trying to add it. This avoids issues with the headers growing too large if the header function is called repeatedly, as it would add the same header multiple times
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant