-
Notifications
You must be signed in to change notification settings - Fork 252
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
Failing to deserialize VectorStoreFileObject
#229
Comments
Thank you for reporting the error. Your observation that both of the fields should be
You're welcome to see that above works and PR is most welcome! |
It appears that OpenAI also now requires a name when creating a vector store: (Reproducing code) // Create a vector store
let vector_store_handle = client
.vector_stores()
.create( CreateVectorStoreRequest {
file_ids: None,
name: None,
expires_after: None,
chunking_strategy: None,
metadata: None
})
.await?; The fix seems to be changing the following type pub struct CreateVectorStoreRequest {
...
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
...
} I'll write a test covering both and open a pull request shortly, thank you for your fast help! |
Thank you for th PR. The change related to vector store name and the error message is not making sense to me, can you elaborate? |
Upon further investigation, it appears that there's another bug (because of inconstency in the spec). You can actually create a vector store by just providing file_ids, in which case name will be null:
That means the actual bug is in So you can safely undo the |
…Strategy (#230) * fix: Update vector store file chunking strategy to use StaticChunkingStrategy This targets the changes mentioned in #229, because OpenAI requires a non-null name when creating a vector store. This also fixes attaching a file to a vector store, where it would fail to deserialize. Also adds a test for both errors to catch them during development in the future! #229 * bugfix: Made optional name field consistent to OpenAI spec Reverted according to recent comments on #229, reasoning can be found on thread. * chore: Modified redudant code in test Related details can be found in PR #230 * test: Update tests to double check for a failure in add file to vector store Related PR: #230 Co-authored-by: Himanshu Neema <himanshun.iitkgp@gmail.com> --------- Co-authored-by: Himanshu Neema <himanshun.iitkgp@gmail.com>
Error:
Failing code:
Looks like the issue is here:
I'm new to Rust, but it seems like the
max_chunk_size_tokens
andchunk_overlap_tokens
fields may need to bepub
?The text was updated successfully, but these errors were encountered: