SDKs 0.22.0 type the new error body and fix retries
The TypeScript, Python, and Go SDKs 0.22.0 read errors by code, stop waiting for the rate-limit window on server errors, never retry a 409, honour aborts and deadlines during a backoff, and work on Python 3.8 and 3.9.
SDKBreakingFix
The TypeScript (@predictorsdk/client), Python (predictorsdk), and Go (github.com/PredictorSDK/sdk-go) SDKs are released at 0.22.0, typing the new error shape shipped the same day. Upgrade now if you use Python: 0.21.0 and earlier require the removed error member, so every error response raises a ParsingError instead of its typed error.
- Errors are read by
code.ErrorResponseiscode,message,statusCode(status_codein Python,StatusCodein Go), and the optionalparamanderrors, a list ofErrorParamProblem(param,value,message). The 409 and 402 bodies carrycodeandmessagetoo. Theerrorfield is gone, so replaceerror.body.errorwitherror.body.code, orerror.body.messagefor display. - A server error no longer waits for the rate-limit window. The SDKs waited until
X-RateLimit-Resetbefore retrying a502or503, up to a minute per retry, because the API sends that header on every response. Only a429waits for it now. Other retried statuses honourRetry-Afterand otherwise back off from one second. - Python no longer retries a
409. An ambiguous identifier answers the same409every time, so a bare ID took over a minute and three requests to fail. CatchConflictErrorand retry with aplatformfrome.body.candidates. - An abort or a deadline ends a wait. A TypeScript
abortSignaland a Gocontextnow cancel a backoff in progress, where the SDK used to finish the wait first. Go also returns after its last attempt instead of waiting once more. - Python 3.8 and 3.9 work with pydantic 2. Every call raised
TypeError: unsupported operand type(s) for |on the versions the package declares, including thepython3macOS ships. CI now tests 3.9 as well as 3.12. - The docstrings match the API: market detail lists one outcome per option on a grouped market,
pricing.sourcenames every venue, and each status maps all nine venues.