Skip to content

Add vector store apis for assistants - #153

Open
jallier wants to merge 4 commits into
orhanerday:mainfrom
jallier:add-vector-store-api
Open

Add vector store apis for assistants#153
jallier wants to merge 4 commits into
orhanerday:mainfrom
jallier:add-vector-store-api

Conversation

@jallier

@jallier jallier commented Dec 8, 2024

Copy link
Copy Markdown

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
Comment thread src/Url.php
{
return self::OPEN_AI_URL . "/audio/speech";
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you should Add PhpDoc

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.

2 participants