Create a new video generation job by editing a source video or existing generated video. Args: prompt: Text prompt that describes how to edit the source video. video: Reference to the completed video to edit. extra_headers: Send extra headers
(
self,
*,
prompt: str,
video: video_edit_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,
)
| 1014 | ) |
| 1015 | |
| 1016 | async def edit( |
| 1017 | self, |
| 1018 | *, |
| 1019 | prompt: str, |
| 1020 | video: video_edit_params.Video, |
| 1021 | # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 1022 | # The extra values given here take precedence over values defined on the client or passed to this method. |
| 1023 | extra_headers: Headers | None = None, |
| 1024 | extra_query: Query | None = None, |
| 1025 | extra_body: Body | None = None, |
| 1026 | timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 1027 | ) -> Video: |
| 1028 | """ |
| 1029 | Create a new video generation job by editing a source video or existing |
| 1030 | generated video. |
| 1031 | |
| 1032 | Args: |
| 1033 | prompt: Text prompt that describes how to edit the source video. |
| 1034 | |
| 1035 | video: Reference to the completed video to edit. |
| 1036 | |
| 1037 | extra_headers: Send extra headers |
| 1038 | |
| 1039 | extra_query: Add additional query parameters to the request |
| 1040 | |
| 1041 | extra_body: Add additional JSON properties to the request |
| 1042 | |
| 1043 | timeout: Override the client-level default timeout for this request, in seconds |
| 1044 | """ |
| 1045 | body = deepcopy_with_paths( |
| 1046 | { |
| 1047 | "prompt": prompt, |
| 1048 | "video": video, |
| 1049 | }, |
| 1050 | [["video"]], |
| 1051 | ) |
| 1052 | files = extract_files(cast(Mapping[str, object], body), paths=[["video"]]) |
| 1053 | # It should be noted that the actual Content-Type header that will be |
| 1054 | # sent to the server will contain a `boundary` parameter, e.g. |
| 1055 | # multipart/form-data; boundary=---abc-- |
| 1056 | extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} |
| 1057 | return await self._post( |
| 1058 | "/videos/edits", |
| 1059 | body=await async_maybe_transform(body, video_edit_params.VideoEditParams), |
| 1060 | files=files, |
| 1061 | options=make_request_options( |
| 1062 | extra_headers=extra_headers, |
| 1063 | extra_query=extra_query, |
| 1064 | extra_body=extra_body, |
| 1065 | timeout=timeout, |
| 1066 | security={"bearer_auth": True}, |
| 1067 | ), |
| 1068 | cast_to=Video, |
| 1069 | ) |
| 1070 | |
| 1071 | async def extend( |
| 1072 | self, |
nothing calls this directly
no test coverage detected