Create an extension of a completed video. Args: prompt: Updated text prompt that directs the extension generation. seconds: Length of the newly generated extension segment in seconds (allowed values: 4, 8, 12, 16, 20). video: Reference
(
self,
*,
prompt: str,
seconds: VideoSeconds,
video: video_extend_params.Video,
# 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,
)
| 1069 | ) |
| 1070 | |
| 1071 | async def extend( |
| 1072 | self, |
| 1073 | *, |
| 1074 | prompt: str, |
| 1075 | seconds: VideoSeconds, |
| 1076 | video: video_extend_params.Video, |
| 1077 | # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 1078 | # The extra values given here take precedence over values defined on the client or passed to this method. |
| 1079 | extra_headers: Headers | None = None, |
| 1080 | extra_query: Query | None = None, |
| 1081 | extra_body: Body | None = None, |
| 1082 | timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 1083 | ) -> Video: |
| 1084 | """ |
| 1085 | Create an extension of a completed video. |
| 1086 | |
| 1087 | Args: |
| 1088 | prompt: Updated text prompt that directs the extension generation. |
| 1089 | |
| 1090 | seconds: Length of the newly generated extension segment in seconds (allowed values: 4, |
| 1091 | 8, 12, 16, 20). |
| 1092 | |
| 1093 | video: Reference to the completed video to extend. |
| 1094 | |
| 1095 | extra_headers: Send extra headers |
| 1096 | |
| 1097 | extra_query: Add additional query parameters to the request |
| 1098 | |
| 1099 | extra_body: Add additional JSON properties to the request |
| 1100 | |
| 1101 | timeout: Override the client-level default timeout for this request, in seconds |
| 1102 | """ |
| 1103 | body = deepcopy_with_paths( |
| 1104 | { |
| 1105 | "prompt": prompt, |
| 1106 | "seconds": seconds, |
| 1107 | "video": video, |
| 1108 | }, |
| 1109 | [["video"]], |
| 1110 | ) |
| 1111 | files = extract_files(cast(Mapping[str, object], body), paths=[["video"]]) |
| 1112 | # It should be noted that the actual Content-Type header that will be |
| 1113 | # sent to the server will contain a `boundary` parameter, e.g. |
| 1114 | # multipart/form-data; boundary=---abc-- |
| 1115 | extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} |
| 1116 | return await self._post( |
| 1117 | "/videos/extensions", |
| 1118 | body=await async_maybe_transform(body, video_extend_params.VideoExtendParams), |
| 1119 | files=files, |
| 1120 | options=make_request_options( |
| 1121 | extra_headers=extra_headers, |
| 1122 | extra_query=extra_query, |
| 1123 | extra_body=extra_body, |
| 1124 | timeout=timeout, |
| 1125 | security={"bearer_auth": True}, |
| 1126 | ), |
| 1127 | cast_to=Video, |
| 1128 | ) |
nothing calls this directly
no test coverage detected