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

Add wait parameter to prediction creation methods #308

Merged
merged 7 commits into from
Sep 25, 2024
Merged

Conversation

mattt
Copy link
Contributor

@mattt mattt commented Sep 23, 2024

No description provided.

@mattt mattt requested a review from aron September 23, 2024 13:09
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.

Is the intention here to roll this out quietly via the block param for testing?

@mattt
Copy link
Contributor Author

mattt commented Sep 25, 2024

Is the intention here to roll this out quietly via the block param for testing?

Sort of. Because of how run wraps createPrediction, we need to make block a parameter to set the right headers in the original request. So most people will continue using replicate.run, but I suppose they could start using predictions.create and opt-in to the same behavior.

@mattt mattt changed the title Add block parameter to prediction creation methods Add wait parameter to prediction creation methods Sep 25, 2024
@mattt mattt force-pushed the mattt/blocking-run branch from eb34008 to 0c0245d Compare September 25, 2024 18:31
@mattt mattt merged commit 173b31d into main Sep 25, 2024
19 checks passed
@mattt mattt deleted the mattt/blocking-run branch September 25, 2024 18:35
stream?: boolean;
webhook?: string;
webhook_events_filter?: WebhookEventType[];
block?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I preferred the version we had that exposed wait here. Where wait was one of:

wait?: { mode: "block", timeout?: number } | { mode: "poll", interval?: number }

This way we have only one param consistently, and it defaults to {mode: "block"}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants