Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update deployments.createPrediction to use wait #322

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

evilstreak
Copy link
Contributor

A first draft of this interface used block, but we ended up going with wait (as either a boolean or a number) for the predictions.createPrediction method. This commit brings the two implementations inline, and deprecates the block parameter.

Note: it would be nice to emit a warning about the deprecation if this method is called with the block parameter, but I'm not sure how to do that reliably across platforms. Advice welcome!

@evilstreak evilstreak requested review from zeke and aron October 15, 2024 10:27
@evilstreak evilstreak force-pushed the replace-block-with-wait branch from bddc975 to 5f8cfde Compare October 15, 2024 10:33
Copy link

@meatballhat meatballhat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@aron aron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this is a bug rather than a feature. The final interface was always intended to be create. I think we just remove the block param entirely here and keep the implementation as you have it.

https://github.com/replicate/replicate-javascript/blob/main/index.d.ts#L210-L221

A first draft of this interface used `block`, but we ended up going with `wait`
(as either a boolean or a number) for the predictions.createPrediction method.
This commit brings the two implementations inline, removing the undocumented
and unintended `block` parameter.
@evilstreak evilstreak force-pushed the replace-block-with-wait branch from 5f8cfde to fc9032f Compare October 16, 2024 14:19
@evilstreak evilstreak requested a review from aron October 16, 2024 14:19
@evilstreak
Copy link
Contributor Author

@aron I've completely removed the old block parameter

Copy link
Contributor

@aron aron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 Ta very much

@evilstreak evilstreak merged commit ec31f40 into main Oct 16, 2024
19 checks passed
@evilstreak evilstreak deleted the replace-block-with-wait branch October 16, 2024 14:23
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants