This PR introduces support for OpenAI Vector Store with Assistant struct.
Main changes:
[ ] New assistants::openai::openai_vector_store module with a new public struct OpenAIVectorStore.
[ ] Basic methods for OpenAIVectorStore including initialization, status check and deletion. We may need to add additional methods in the future. For this PR I kept it to the basics.
[ ] Modification to OpenAIAssistant to support attaching a Vector Store and running file search against it.
[ ] Modification to use_openai_assistnat example to showcase new capabilities.
Example usage:
// You still need to first upload a file
let openai_file = OpenAIFile::new(&file_name, bytes, &api_key, true).await?;
// Create a Vector Store and assign the file to it
let openai_vector_store = OpenAIVectorStore::new(None, "Concerts", &api_key)
.debug()
.upload(&[openai_file.id.clone()])
.await?;
// Attach Vectore Store to an Assistant and use it for search
let concert_info = OpenAIAssistant::new(OpenAIModels::Gpt4o, &api_key, true)
.await?
.version(OpenAIAssistantVersion::V2)
.vector_store(openai_vector_store.clone())
.await?
.get_answer::<ConcertInfo>(
"Extract the information requested in the response type from the attached concert information.
The response should include the genre of the music the 'band' represents.
The mapping of bands to genres was provided in 'bands_genres' list in a previous message.",
&[], // No files attached to the message. Assistant will use the Vector Store
)
.await?;
// Delete the Vector Store
openai_vector_store.delete().await?;
This PR introduces support for OpenAI Vector Store with Assistant struct.
Main changes:
assistants::openai::openai_vector_store
module with a new public structOpenAIVectorStore
.OpenAIVectorStore
including initialization, status check and deletion. We may need to add additional methods in the future. For this PR I kept it to the basics.OpenAIAssistant
to support attaching a Vector Store and running file search against it.use_openai_assistnat
example to showcase new capabilities.Example usage: