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

Method create_character

src/openai/resources/videos.py:337–389  ·  src/openai/resources/videos.py::Videos.create_character

Create a character from an uploaded video. Args: name: Display name for this API character. video: Video file used to create a character. extra_headers: Send extra headers extra_query: Add additional query parameters to the request

(
        self,
        *,
        name: str,
        video: FileTypes,
        # 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

335 )
336
337 def create_character(
338 self,
339 *,
340 name: str,
341 video: FileTypes,
342 class="cm"># Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
343 class="cm"># The extra values given here take precedence over values defined on the client or passed to this method.
344 extra_headers: Headers | None = None,
345 extra_query: Query | None = None,
346 extra_body: Body | None = None,
347 timeout: float | httpx.Timeout | None | NotGiven = not_given,
348 ) -> VideoCreateCharacterResponse:
349 class="st">"""
350 Create a character from an uploaded video.
351
352 Args:
353 name: Display name for this API character.
354
355 video: Video file used to create a character.
356
357 extra_headers: Send extra headers
358
359 extra_query: Add additional query parameters to the request
360
361 extra_body: Add additional JSON properties to the request
362
363 timeout: Override the client-level default timeout for this request, in seconds
364 class="st">"""
365 body = deepcopy_with_paths(
366 {
367 class="st">"name": name,
368 class="st">"video": video,
369 },
370 [[class="st">"video"]],
371 )
372 files = extract_files(cast(Mapping[str, object], body), paths=[[class="st">"video"]])
373 class="cm"># It should be noted that the actual Content-Type header that will be
374 class="cm"># sent to the server will contain a `boundary` parameter, e.g.
375 class="cm"># multipart/form-data; boundary=---abc--
376 extra_headers = {class="st">"Content-Type": class="st">"multipart/form-data", **(extra_headers or {})}
377 return self._post(
378 class="st">"/videos/characters",
379 body=maybe_transform(body, video_create_character_params.VideoCreateCharacterParams),
380 files=files,
381 options=make_request_options(
382 extra_headers=extra_headers,
383 extra_query=extra_query,
384 extra_body=extra_body,
385 timeout=timeout,
386 security={class="st">"bearer_auth": True},
387 ),
388 cast_to=VideoCreateCharacterResponse,
389 )
390
391 def download_content(
392 self,

Calls 4

deepcopy_with_pathsFunction · 0.85
extract_filesFunction · 0.85
maybe_transformFunction · 0.85
make_request_optionsFunction · 0.85