You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Inference] request() returns a request context to avoid redundant makeRequestOptions calls (#1314)
Related to @SBrandeis's comment here
#1292 (comment).
This PR addresses the original concern about redundant
`makeRequestOptions` calls introduced in #1292.The solution implemented
here updates the `request` function to return both the response and a
_request context_ when needed, allowing provider-specific polling code
to reuse this context without redundant calls to `makeRequestOptions`.
This differs from the initial suggestion in the comment as each provider
implements polling differently with different parameters / response
formats. Making a generic `.poll` property would require mixing
provider-specific logic into the core request function (we don't want
that, right? 😄 ).
In the end, we want to keep provider-specific logic isolated in their
respective provider files (PR coming today to push that further!).
0 commit comments