Create a video and wait for it to be processed.
(
self,
*,
prompt: str,
input_reference: video_create_params.InputReference | Omit = omit,
model: VideoModelParam | Omit = omit,
seconds: VideoSeconds | Omit = omit,
size: VideoSize | Omit = omit,
poll_interval_ms: int | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
)
| 714 | ) |
| 715 | |
| 716 | async def create_and_poll( |
| 717 | self, |
| 718 | *, |
| 719 | prompt: str, |
| 720 | input_reference: video_create_params.InputReference | Omit = omit, |
| 721 | model: VideoModelParam | Omit = omit, |
| 722 | seconds: VideoSeconds | Omit = omit, |
| 723 | size: VideoSize | Omit = omit, |
| 724 | poll_interval_ms: int | Omit = omit, |
| 725 | # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 726 | # The extra values given here take precedence over values defined on the client or passed to this method. |
| 727 | extra_headers: Headers | None = None, |
| 728 | extra_query: Query | None = None, |
| 729 | extra_body: Body | None = None, |
| 730 | timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 731 | ) -> Video: |
| 732 | """Create a video and wait for it to be processed.""" |
| 733 | video = await self.create( |
| 734 | model=model, |
| 735 | prompt=prompt, |
| 736 | input_reference=input_reference, |
| 737 | seconds=seconds, |
| 738 | size=size, |
| 739 | extra_headers=extra_headers, |
| 740 | extra_query=extra_query, |
| 741 | extra_body=extra_body, |
| 742 | timeout=timeout, |
| 743 | ) |
| 744 | |
| 745 | return await self.poll( |
| 746 | video.id, |
| 747 | poll_interval_ms=poll_interval_ms, |
| 748 | ) |
| 749 | |
| 750 | async def poll( |
| 751 | self, |