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

Method create_character

src/openai/resources/videos.py:337–389  ·  view source on GitHub ↗

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 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
343 # 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 """
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 """
365 body = deepcopy_with_paths(
366 {
367 "name": name,
368 "video": video,
369 },
370 [["video"]],
371 )
372 files = extract_files(cast(Mapping[str, object], body), paths=[["video"]])
373 # It should be noted that the actual Content-Type header that will be
374 # sent to the server will contain a `boundary` parameter, e.g.
375 # multipart/form-data; boundary=---abc--
376 extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
377 return self._post(
378 "/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={"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