@@ -95,8 +95,7 @@ def create(
9595 Args:
9696 prompt: Text prompt that describes the video to generate.
9797
98- input_reference: Optional reference object that guides generation. Provide exactly one of
99- `image_url` or `file_id`.
98+ input_reference: Optional reference asset upload or reference object that guides generation.
10099
101100 model: The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults
102101 to `sora-2`.
@@ -124,11 +123,10 @@ def create(
124123 }
125124 )
126125 files = extract_files (cast (Mapping [str , object ], body ), paths = [["input_reference" ]])
127- if files :
128- # It should be noted that the actual Content-Type header that will be
129- # sent to the server will contain a `boundary` parameter, e.g.
130- # multipart/form-data; boundary=---abc--
131- extra_headers = {"Content-Type" : "multipart/form-data" , ** (extra_headers or {})}
126+ # It should be noted that the actual Content-Type header that will be
127+ # sent to the server will contain a `boundary` parameter, e.g.
128+ # multipart/form-data; boundary=---abc--
129+ extra_headers = {"Content-Type" : "multipart/form-data" , ** (extra_headers or {})}
132130 return self ._post (
133131 "/videos" ,
134132 body = maybe_transform (body , video_create_params .VideoCreateParams ),
@@ -409,11 +407,10 @@ def edit(
409407 }
410408 )
411409 files = extract_files (cast (Mapping [str , object ], body ), paths = [["video" ]])
412- if files :
413- # It should be noted that the actual Content-Type header that will be
414- # sent to the server will contain a `boundary` parameter, e.g.
415- # multipart/form-data; boundary=---abc--
416- extra_headers = {"Content-Type" : "multipart/form-data" , ** (extra_headers or {})}
410+ # It should be noted that the actual Content-Type header that will be
411+ # sent to the server will contain a `boundary` parameter, e.g.
412+ # multipart/form-data; boundary=---abc--
413+ extra_headers = {"Content-Type" : "multipart/form-data" , ** (extra_headers or {})}
417414 return self ._post (
418415 "/videos/edits" ,
419416 body = maybe_transform (body , video_edit_params .VideoEditParams ),
@@ -446,7 +443,7 @@ def extend(
446443 seconds: Length of the newly generated extension segment in seconds (allowed values: 4,
447444 8, 12, 16, 20).
448445
449- video: Reference to the completed video to extend .
446+ video: Reference to the completed video.
450447
451448 extra_headers: Send extra headers
452449
@@ -464,11 +461,10 @@ def extend(
464461 }
465462 )
466463 files = extract_files (cast (Mapping [str , object ], body ), paths = [["video" ]])
467- if files :
468- # It should be noted that the actual Content-Type header that will be
469- # sent to the server will contain a `boundary` parameter, e.g.
470- # multipart/form-data; boundary=---abc--
471- extra_headers = {"Content-Type" : "multipart/form-data" , ** (extra_headers or {})}
464+ # It should be noted that the actual Content-Type header that will be
465+ # sent to the server will contain a `boundary` parameter, e.g.
466+ # multipart/form-data; boundary=---abc--
467+ extra_headers = {"Content-Type" : "multipart/form-data" , ** (extra_headers or {})}
472468 return self ._post (
473469 "/videos/extensions" ,
474470 body = maybe_transform (body , video_extend_params .VideoExtendParams ),
@@ -562,8 +558,7 @@ async def create(
562558 Args:
563559 prompt: Text prompt that describes the video to generate.
564560
565- input_reference: Optional reference object that guides generation. Provide exactly one of
566- `image_url` or `file_id`.
561+ input_reference: Optional reference asset upload or reference object that guides generation.
567562
568563 model: The video generation model to use (allowed values: sora-2, sora-2-pro). Defaults
569564 to `sora-2`.
@@ -591,11 +586,10 @@ async def create(
591586 }
592587 )
593588 files = extract_files (cast (Mapping [str , object ], body ), paths = [["input_reference" ]])
594- if files :
595- # It should be noted that the actual Content-Type header that will be
596- # sent to the server will contain a `boundary` parameter, e.g.
597- # multipart/form-data; boundary=---abc--
598- extra_headers = {"Content-Type" : "multipart/form-data" , ** (extra_headers or {})}
589+ # It should be noted that the actual Content-Type header that will be
590+ # sent to the server will contain a `boundary` parameter, e.g.
591+ # multipart/form-data; boundary=---abc--
592+ extra_headers = {"Content-Type" : "multipart/form-data" , ** (extra_headers or {})}
599593 return await self ._post (
600594 "/videos" ,
601595 body = await async_maybe_transform (body , video_create_params .VideoCreateParams ),
@@ -878,11 +872,10 @@ async def edit(
878872 }
879873 )
880874 files = extract_files (cast (Mapping [str , object ], body ), paths = [["video" ]])
881- if files :
882- # It should be noted that the actual Content-Type header that will be
883- # sent to the server will contain a `boundary` parameter, e.g.
884- # multipart/form-data; boundary=---abc--
885- extra_headers = {"Content-Type" : "multipart/form-data" , ** (extra_headers or {})}
875+ # It should be noted that the actual Content-Type header that will be
876+ # sent to the server will contain a `boundary` parameter, e.g.
877+ # multipart/form-data; boundary=---abc--
878+ extra_headers = {"Content-Type" : "multipart/form-data" , ** (extra_headers or {})}
886879 return await self ._post (
887880 "/videos/edits" ,
888881 body = await async_maybe_transform (body , video_edit_params .VideoEditParams ),
@@ -915,7 +908,7 @@ async def extend(
915908 seconds: Length of the newly generated extension segment in seconds (allowed values: 4,
916909 8, 12, 16, 20).
917910
918- video: Reference to the completed video to extend .
911+ video: Reference to the completed video.
919912
920913 extra_headers: Send extra headers
921914
@@ -933,11 +926,10 @@ async def extend(
933926 }
934927 )
935928 files = extract_files (cast (Mapping [str , object ], body ), paths = [["video" ]])
936- if files :
937- # It should be noted that the actual Content-Type header that will be
938- # sent to the server will contain a `boundary` parameter, e.g.
939- # multipart/form-data; boundary=---abc--
940- extra_headers = {"Content-Type" : "multipart/form-data" , ** (extra_headers or {})}
929+ # It should be noted that the actual Content-Type header that will be
930+ # sent to the server will contain a `boundary` parameter, e.g.
931+ # multipart/form-data; boundary=---abc--
932+ extra_headers = {"Content-Type" : "multipart/form-data" , ** (extra_headers or {})}
941933 return await self ._post (
942934 "/videos/extensions" ,
943935 body = await async_maybe_transform (body , video_extend_params .VideoExtendParams ),
0 commit comments