66
77import httpx
88
9+ from .image import (
10+ ImageResource ,
11+ AsyncImageResource ,
12+ ImageResourceWithRawResponse ,
13+ AsyncImageResourceWithRawResponse ,
14+ ImageResourceWithStreamingResponse ,
15+ AsyncImageResourceWithStreamingResponse ,
16+ )
17+ from .video import (
18+ VideoResource ,
19+ AsyncVideoResource ,
20+ VideoResourceWithRawResponse ,
21+ AsyncVideoResourceWithRawResponse ,
22+ VideoResourceWithStreamingResponse ,
23+ AsyncVideoResourceWithStreamingResponse ,
24+ )
925from ...types import generation_list_params , generation_create_params
1026from ..._types import NOT_GIVEN , Body , Query , Headers , NoneType , NotGiven
1127from ..._utils import (
@@ -40,6 +56,14 @@ class GenerationsResource(SyncAPIResource):
4056 def camera_motion (self ) -> CameraMotionResource :
4157 return CameraMotionResource (self ._client )
4258
59+ @cached_property
60+ def image (self ) -> ImageResource :
61+ return ImageResource (self ._client )
62+
63+ @cached_property
64+ def video (self ) -> VideoResource :
65+ return VideoResource (self ._client )
66+
4367 @cached_property
4468 def with_raw_response (self ) -> GenerationsResourceWithRawResponse :
4569 """
@@ -64,6 +88,7 @@ def create(
6488 * ,
6589 aspect_ratio : Literal ["1:1" , "16:9" , "9:16" , "4:3" , "3:4" , "21:9" , "9:21" ] | NotGiven = NOT_GIVEN ,
6690 callback_url : str | NotGiven = NOT_GIVEN ,
91+ generation_type : Literal ["video" ] | NotGiven = NOT_GIVEN ,
6792 keyframes : generation_create_params .Keyframes | NotGiven = NOT_GIVEN ,
6893 loop : bool | NotGiven = NOT_GIVEN ,
6994 prompt : str | NotGiven = NOT_GIVEN ,
@@ -104,6 +129,7 @@ def create(
104129 {
105130 "aspect_ratio" : aspect_ratio ,
106131 "callback_url" : callback_url ,
132+ "generation_type" : generation_type ,
107133 "keyframes" : keyframes ,
108134 "loop" : loop ,
109135 "prompt" : prompt ,
@@ -231,6 +257,14 @@ class AsyncGenerationsResource(AsyncAPIResource):
231257 def camera_motion (self ) -> AsyncCameraMotionResource :
232258 return AsyncCameraMotionResource (self ._client )
233259
260+ @cached_property
261+ def image (self ) -> AsyncImageResource :
262+ return AsyncImageResource (self ._client )
263+
264+ @cached_property
265+ def video (self ) -> AsyncVideoResource :
266+ return AsyncVideoResource (self ._client )
267+
234268 @cached_property
235269 def with_raw_response (self ) -> AsyncGenerationsResourceWithRawResponse :
236270 """
@@ -255,6 +289,7 @@ async def create(
255289 * ,
256290 aspect_ratio : Literal ["1:1" , "16:9" , "9:16" , "4:3" , "3:4" , "21:9" , "9:21" ] | NotGiven = NOT_GIVEN ,
257291 callback_url : str | NotGiven = NOT_GIVEN ,
292+ generation_type : Literal ["video" ] | NotGiven = NOT_GIVEN ,
258293 keyframes : generation_create_params .Keyframes | NotGiven = NOT_GIVEN ,
259294 loop : bool | NotGiven = NOT_GIVEN ,
260295 prompt : str | NotGiven = NOT_GIVEN ,
@@ -295,6 +330,7 @@ async def create(
295330 {
296331 "aspect_ratio" : aspect_ratio ,
297332 "callback_url" : callback_url ,
333+ "generation_type" : generation_type ,
298334 "keyframes" : keyframes ,
299335 "loop" : loop ,
300336 "prompt" : prompt ,
@@ -438,6 +474,14 @@ def __init__(self, generations: GenerationsResource) -> None:
438474 def camera_motion (self ) -> CameraMotionResourceWithRawResponse :
439475 return CameraMotionResourceWithRawResponse (self ._generations .camera_motion )
440476
477+ @cached_property
478+ def image (self ) -> ImageResourceWithRawResponse :
479+ return ImageResourceWithRawResponse (self ._generations .image )
480+
481+ @cached_property
482+ def video (self ) -> VideoResourceWithRawResponse :
483+ return VideoResourceWithRawResponse (self ._generations .video )
484+
441485
442486class AsyncGenerationsResourceWithRawResponse :
443487 def __init__ (self , generations : AsyncGenerationsResource ) -> None :
@@ -460,6 +504,14 @@ def __init__(self, generations: AsyncGenerationsResource) -> None:
460504 def camera_motion (self ) -> AsyncCameraMotionResourceWithRawResponse :
461505 return AsyncCameraMotionResourceWithRawResponse (self ._generations .camera_motion )
462506
507+ @cached_property
508+ def image (self ) -> AsyncImageResourceWithRawResponse :
509+ return AsyncImageResourceWithRawResponse (self ._generations .image )
510+
511+ @cached_property
512+ def video (self ) -> AsyncVideoResourceWithRawResponse :
513+ return AsyncVideoResourceWithRawResponse (self ._generations .video )
514+
463515
464516class GenerationsResourceWithStreamingResponse :
465517 def __init__ (self , generations : GenerationsResource ) -> None :
@@ -482,6 +534,14 @@ def __init__(self, generations: GenerationsResource) -> None:
482534 def camera_motion (self ) -> CameraMotionResourceWithStreamingResponse :
483535 return CameraMotionResourceWithStreamingResponse (self ._generations .camera_motion )
484536
537+ @cached_property
538+ def image (self ) -> ImageResourceWithStreamingResponse :
539+ return ImageResourceWithStreamingResponse (self ._generations .image )
540+
541+ @cached_property
542+ def video (self ) -> VideoResourceWithStreamingResponse :
543+ return VideoResourceWithStreamingResponse (self ._generations .video )
544+
485545
486546class AsyncGenerationsResourceWithStreamingResponse :
487547 def __init__ (self , generations : AsyncGenerationsResource ) -> None :
@@ -503,3 +563,11 @@ def __init__(self, generations: AsyncGenerationsResource) -> None:
503563 @cached_property
504564 def camera_motion (self ) -> AsyncCameraMotionResourceWithStreamingResponse :
505565 return AsyncCameraMotionResourceWithStreamingResponse (self ._generations .camera_motion )
566+
567+ @cached_property
568+ def image (self ) -> AsyncImageResourceWithStreamingResponse :
569+ return AsyncImageResourceWithStreamingResponse (self ._generations .image )
570+
571+ @cached_property
572+ def video (self ) -> AsyncVideoResourceWithStreamingResponse :
573+ return AsyncVideoResourceWithStreamingResponse (self ._generations .video )
0 commit comments