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

VectorStores list method errors out when no stores defined for a project #242

Closed
vrurg opened this issue Jul 12, 2024 · 5 comments · Fixed by #270
Closed

VectorStores list method errors out when no stores defined for a project #242

vrurg opened this issue Jul 12, 2024 · 5 comments · Fixed by #270
Labels
bug Something isn't working

Comments

@vrurg
Copy link
Contributor

vrurg commented Jul 12, 2024

When attempting to list vector stores of a project where no store created yet the method list results in:

Error: JSONDeserialize(Error("invalid type: null, expected a string", line: 4, column: 18))

Perhaps the problem is in field data of ListVectorStoresResponse is just a Vec whereas the API can return a JSON null for it.

The proper fix would be turning the Vec into Option<Vec>, but it's a breaking change.

@64bit
Copy link
Owner

64bit commented Jul 12, 2024

Thanks for reporting the error. Do you mind running same example with tracing enabled? so that actual payload which was failed to deserialize is printed, please also post the payload.

@64bit 64bit added the bug Something isn't working label Jul 12, 2024
@vrurg
Copy link
Contributor Author

vrurg commented Jul 13, 2024

No problem, if I can find out how to enable it. :) I'm afraid, your help in a form of advise is needed here.

@64bit
Copy link
Owner

64bit commented Jul 14, 2024

Here's an example which set up tracing and library already has code to log paylod.

https://github.com/64bit/async-openai/blob/main/examples/assistants-func-call-stream/src/main.rs#L19

(perhaps this is another opportunity for improvement where failed payload can be part of the JSONDeserialize variant of OpenAIError so its easily available - however that puts burden on the user to log it - logging in the library makes it available for everyone. perhaps having both can be a an option too)

@vrurg
Copy link
Contributor Author

vrurg commented Jul 17, 2024

I finally got time to give the tracing a try. Here is what it says:

2024-07-17T21:18:46.326525Z ERROR async_openai::error: failed deserialization of: {
  "object": "list",
  "data": [],
  "first_id": null,
  "last_id": null,
  "has_more": false
}
Error: JSONDeserialize(Error("invalid type: null, expected a string", line: 4, column: 18))

@64bit
Copy link
Owner

64bit commented Jul 18, 2024

Thank you for providing the error. This means that the bug is last_id and first_id needs to be Optional in ListVectorStoresResponse

https://github.com/64bit/async-openai/blob/main/async-openai/src/types/vector_store.rs#L108-L109

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants