MCPcopy
hub / github.com/openai/openai-python / create_and_poll

Method create_and_poll

src/openai/resources/videos.py:137–169  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

135 )
136
137 def create_and_poll(
138 self,
139 *,
140 prompt: str,
141 input_reference: video_create_params.InputReference | Omit = omit,
142 model: VideoModelParam | Omit = omit,
143 seconds: VideoSeconds | Omit = omit,
144 size: VideoSize | Omit = omit,
145 poll_interval_ms: int | Omit = omit,
146 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
147 # The extra values given here take precedence over values defined on the client or passed to this method.
148 extra_headers: Headers | None = None,
149 extra_query: Query | None = None,
150 extra_body: Body | None = None,
151 timeout: float | httpx.Timeout | None | NotGiven = not_given,
152 ) -> Video:
153 """Create a video and wait for it to be processed."""
154 video = self.create(
155 model=model,
156 prompt=prompt,
157 input_reference=input_reference,
158 seconds=seconds,
159 size=size,
160 extra_headers=extra_headers,
161 extra_query=extra_query,
162 extra_body=extra_body,
163 timeout=timeout,
164 )
165
166 return self.poll(
167 video.id,
168 poll_interval_ms=poll_interval_ms,
169 )
170
171 def poll(
172 self,

Callers 1

mainFunction · 0.45

Calls 2

createMethod · 0.95
pollMethod · 0.95

Tested by

no test coverage detected