Skip to content

Add wait parameter to prediction creation methods - #308

Merged
mattt merged 7 commits into
mainfrom
mattt/blocking-run
Sep 25, 2024
Merged

Add wait parameter to prediction creation methods#308
mattt merged 7 commits into
mainfrom
mattt/blocking-run

Conversation

@mattt

Copy link
Copy Markdown
Contributor

No description provided.

@mattt
mattt requested a review from aronSeptember 23, 2024 13:09

@aronaron left a comment

Copy link
Copy Markdown
Contributor

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?

Comment threadindex.js Outdated
Comment threadlib/deployments.js Outdated
@mattt

Copy link
Copy Markdown
ContributorAuthor

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.

@matttmattt changed the title Add block parameter to prediction creation methodsAdd wait parameter to prediction creation methodsSep 25, 2024
@mattt
mattt merged commit 173b31d into mainSep 25, 2024
@mattt
mattt deleted the mattt/blocking-run branch September 25, 2024 18:35
Comment threadindex.d.ts
stream?: boolean;
webhook?: string;
webhook_events_filter?: WebhookEventType[];
block?: boolean;

Copy link
Copy Markdown
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 freeto 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

@mattt@aron