[QUESTION] SDK update
Closed this issue · 3 comments
How can we help?
Hello, I wanted to update the SDK from 2.3 to 2.4 and I found a couple if issues.
The issues are mentioned in release notes, but I think they need more documentation.
While method renames are easy to do, there are two issues that stopped me from updating.
In VectorStoreClient.CreateVectorStoreAsync there is no longer a boolean wait parameter, how does this method behave? Does it guarantee creation of vector store once it completes?
Also in VectorStoreClient.CreateBatchFileJobAsync method is missing, how would I go about uploading multiple files? I hope uploading them in a loop is not the new recommended approach?
A general note as well: you should not break your library's contract in a minor version update as per: https://semver.org/
Hi @mpec. Thank you for reaching out and we regret that you're experiencing difficulties. Please be aware that many OpenAI features are still under active development and continuing to evolve for both the service and client. As a result, most of the feature areas in the OpenAI library have been released only in an experimental state and are not expected to be stable; they will change in potentially disruptive ways from release-to-release. This is why they are behind an experimental flag and produce the following warning unless you explicitly opt-in:
OPENAI001 'OpenAI.Responses.OpenAIResponseClient' is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagostic to proceed.
The lifecycle of features and guarantees for stability and back-compat are discussed in Feature Lifecycle in the OpenAI .NET Client Library.
With respect to your VectorStoreClient questions:
In VectorStoreClient.CreateVectorStoreAsync there is no longer a boolean wait parameter, how does this method behave? Does it guarantee creation of vector store once it completes?
It does not. The service contract for the function changed recently in an unexpected way which invalided the previous polling logic. We are in the process of designing a new polling approach for this class of operation. In the meantime, we need to put out a sample that demonstrates how this can be done. We'll look at getting that out in the short term.
Also in VectorStoreClient.CreateBatchFileJobAsync method is missing, how would I go about uploading multiple files?
The name of the method has changed to AddFileBatchToVectorStore in v2.4.
@ShivangiReja: Would you please write an example for manual polling? The new header value is not officially documented, but from the Python source it looks like the service is now returning openai-poll-after-ms.
@jsquire - I ran multiple tests; even when the status was InProgress I didn’t receive an openai-poll-after-ms header. I also tried sending X-Stainless-Poll-Helper: true custom header(like the Python SDK) but the header still wasn’t returned. From the Python SDK, that header appears optional and the poller falls back to a default delay when it’s missing, so I think we shouldn’t rely on it being present every time.
I have a PR out with a manual-polling sample: #682. The sample checks Retry-After and openai-poll-after-ms if available; otherwise it uses a 1s fallback between polls.