Skip to content

Commit 8faa53d

Browse files
feat(api): api update (#94)
1 parent 19b3733 commit 8faa53d

File tree

8 files changed

+90
-1
lines changed

8 files changed

+90
-1
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 8
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/luma-ai-karanganesan%2Fluma_ai-15f705a5789a4671a5cba160123f7325eff333b93dab4292e25ee92e2ef15a68.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/luma-ai-karanganesan%2Fluma_ai-7514d44d25b8dd931de982d593ba0d03467acdda95fc8367ef2732e7ad2e8086.yml

src/lumaai/resources/generations/generations.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from typing import Union
56
from typing_extensions import Literal
67

78
import httpx
@@ -88,10 +89,13 @@ def create(
8889
*,
8990
aspect_ratio: Literal["1:1", "16:9", "9:16", "4:3", "3:4", "21:9", "9:21"] | NotGiven = NOT_GIVEN,
9091
callback_url: str | NotGiven = NOT_GIVEN,
92+
duration: Union[Literal["5s", "9s"], str] | NotGiven = NOT_GIVEN,
9193
generation_type: Literal["video"] | NotGiven = NOT_GIVEN,
9294
keyframes: generation_create_params.Keyframes | NotGiven = NOT_GIVEN,
9395
loop: bool | NotGiven = NOT_GIVEN,
96+
model: Literal["ray-1-6", "ray-2"] | NotGiven = NOT_GIVEN,
9497
prompt: str | NotGiven = NOT_GIVEN,
98+
resolution: Union[Literal["540p", "720p"], str] | NotGiven = NOT_GIVEN,
9599
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
96100
# The extra values given here take precedence over values defined on the client or passed to this method.
97101
extra_headers: Headers | None = None,
@@ -109,12 +113,18 @@ def create(
109113
be sent to the callback URL when the generation is dreaming, completed, or
110114
failed
111115
116+
duration: The duration of the generation
117+
112118
keyframes: The keyframes of the generation
113119
114120
loop: Whether to loop the video
115121
122+
model: The model used for the generation
123+
116124
prompt: The prompt of the generation
117125
126+
resolution: The resolution of the generation
127+
118128
extra_headers: Send extra headers
119129
120130
extra_query: Add additional query parameters to the request
@@ -129,10 +139,13 @@ def create(
129139
{
130140
"aspect_ratio": aspect_ratio,
131141
"callback_url": callback_url,
142+
"duration": duration,
132143
"generation_type": generation_type,
133144
"keyframes": keyframes,
134145
"loop": loop,
146+
"model": model,
135147
"prompt": prompt,
148+
"resolution": resolution,
136149
},
137150
generation_create_params.GenerationCreateParams,
138151
),
@@ -289,10 +302,13 @@ async def create(
289302
*,
290303
aspect_ratio: Literal["1:1", "16:9", "9:16", "4:3", "3:4", "21:9", "9:21"] | NotGiven = NOT_GIVEN,
291304
callback_url: str | NotGiven = NOT_GIVEN,
305+
duration: Union[Literal["5s", "9s"], str] | NotGiven = NOT_GIVEN,
292306
generation_type: Literal["video"] | NotGiven = NOT_GIVEN,
293307
keyframes: generation_create_params.Keyframes | NotGiven = NOT_GIVEN,
294308
loop: bool | NotGiven = NOT_GIVEN,
309+
model: Literal["ray-1-6", "ray-2"] | NotGiven = NOT_GIVEN,
295310
prompt: str | NotGiven = NOT_GIVEN,
311+
resolution: Union[Literal["540p", "720p"], str] | NotGiven = NOT_GIVEN,
296312
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
297313
# The extra values given here take precedence over values defined on the client or passed to this method.
298314
extra_headers: Headers | None = None,
@@ -310,12 +326,18 @@ async def create(
310326
be sent to the callback URL when the generation is dreaming, completed, or
311327
failed
312328
329+
duration: The duration of the generation
330+
313331
keyframes: The keyframes of the generation
314332
315333
loop: Whether to loop the video
316334
335+
model: The model used for the generation
336+
317337
prompt: The prompt of the generation
318338
339+
resolution: The resolution of the generation
340+
319341
extra_headers: Send extra headers
320342
321343
extra_query: Add additional query parameters to the request
@@ -330,10 +352,13 @@ async def create(
330352
{
331353
"aspect_ratio": aspect_ratio,
332354
"callback_url": callback_url,
355+
"duration": duration,
333356
"generation_type": generation_type,
334357
"keyframes": keyframes,
335358
"loop": loop,
359+
"model": model,
336360
"prompt": prompt,
361+
"resolution": resolution,
337362
},
338363
generation_create_params.GenerationCreateParams,
339364
),

src/lumaai/resources/generations/video.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from typing import Union
56
from typing_extensions import Literal
67

78
import httpx
@@ -51,10 +52,13 @@ def create(
5152
*,
5253
aspect_ratio: Literal["1:1", "16:9", "9:16", "4:3", "3:4", "21:9", "9:21"] | NotGiven = NOT_GIVEN,
5354
callback_url: str | NotGiven = NOT_GIVEN,
55+
duration: Union[Literal["5s", "9s"], str] | NotGiven = NOT_GIVEN,
5456
generation_type: Literal["video"] | NotGiven = NOT_GIVEN,
5557
keyframes: video_create_params.Keyframes | NotGiven = NOT_GIVEN,
5658
loop: bool | NotGiven = NOT_GIVEN,
59+
model: Literal["ray-1-6", "ray-2"] | NotGiven = NOT_GIVEN,
5760
prompt: str | NotGiven = NOT_GIVEN,
61+
resolution: Union[Literal["540p", "720p"], str] | NotGiven = NOT_GIVEN,
5862
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5963
# The extra values given here take precedence over values defined on the client or passed to this method.
6064
extra_headers: Headers | None = None,
@@ -72,12 +76,18 @@ def create(
7276
be sent to the callback URL when the generation is dreaming, completed, or
7377
failed
7478
79+
duration: The duration of the generation
80+
7581
keyframes: The keyframes of the generation
7682
7783
loop: Whether to loop the video
7884
85+
model: The model used for the generation
86+
7987
prompt: The prompt of the generation
8088
89+
resolution: The resolution of the generation
90+
8191
extra_headers: Send extra headers
8292
8393
extra_query: Add additional query parameters to the request
@@ -92,10 +102,13 @@ def create(
92102
{
93103
"aspect_ratio": aspect_ratio,
94104
"callback_url": callback_url,
105+
"duration": duration,
95106
"generation_type": generation_type,
96107
"keyframes": keyframes,
97108
"loop": loop,
109+
"model": model,
98110
"prompt": prompt,
111+
"resolution": resolution,
99112
},
100113
video_create_params.VideoCreateParams,
101114
),
@@ -131,10 +144,13 @@ async def create(
131144
*,
132145
aspect_ratio: Literal["1:1", "16:9", "9:16", "4:3", "3:4", "21:9", "9:21"] | NotGiven = NOT_GIVEN,
133146
callback_url: str | NotGiven = NOT_GIVEN,
147+
duration: Union[Literal["5s", "9s"], str] | NotGiven = NOT_GIVEN,
134148
generation_type: Literal["video"] | NotGiven = NOT_GIVEN,
135149
keyframes: video_create_params.Keyframes | NotGiven = NOT_GIVEN,
136150
loop: bool | NotGiven = NOT_GIVEN,
151+
model: Literal["ray-1-6", "ray-2"] | NotGiven = NOT_GIVEN,
137152
prompt: str | NotGiven = NOT_GIVEN,
153+
resolution: Union[Literal["540p", "720p"], str] | NotGiven = NOT_GIVEN,
138154
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
139155
# The extra values given here take precedence over values defined on the client or passed to this method.
140156
extra_headers: Headers | None = None,
@@ -152,12 +168,18 @@ async def create(
152168
be sent to the callback URL when the generation is dreaming, completed, or
153169
failed
154170
171+
duration: The duration of the generation
172+
155173
keyframes: The keyframes of the generation
156174
157175
loop: Whether to loop the video
158176
177+
model: The model used for the generation
178+
159179
prompt: The prompt of the generation
160180
181+
resolution: The resolution of the generation
182+
161183
extra_headers: Send extra headers
162184
163185
extra_query: Add additional query parameters to the request
@@ -172,10 +194,13 @@ async def create(
172194
{
173195
"aspect_ratio": aspect_ratio,
174196
"callback_url": callback_url,
197+
"duration": duration,
175198
"generation_type": generation_type,
176199
"keyframes": keyframes,
177200
"loop": loop,
201+
"model": model,
178202
"prompt": prompt,
203+
"resolution": resolution,
179204
},
180205
video_create_params.VideoCreateParams,
181206
),

src/lumaai/types/generation.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ class RequestGenerationRequest(BaseModel):
101101
failed
102102
"""
103103

104+
duration: Union[Literal["5s", "9s"], str, None] = None
105+
"""The duration of the generation"""
106+
104107
generation_type: Optional[Literal["video"]] = None
105108

106109
keyframes: Optional[RequestGenerationRequestKeyframes] = None
@@ -109,9 +112,15 @@ class RequestGenerationRequest(BaseModel):
109112
loop: Optional[bool] = None
110113
"""Whether to loop the video"""
111114

115+
model: Optional[Literal["ray-1-6", "ray-2"]] = None
116+
"""The model used for the generation"""
117+
112118
prompt: Optional[str] = None
113119
"""The prompt of the generation"""
114120

121+
resolution: Union[Literal["540p", "720p"], str, None] = None
122+
"""The resolution of the generation"""
123+
115124

116125
class RequestImageGenerationRequestCharacterRefIdentity0(BaseModel):
117126
images: Optional[List[str]] = None

src/lumaai/types/generation_create_params.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ class GenerationCreateParams(TypedDict, total=False):
2828
failed
2929
"""
3030

31+
duration: Union[Literal["5s", "9s"], str]
32+
"""The duration of the generation"""
33+
3134
generation_type: Literal["video"]
3235

3336
keyframes: Keyframes
@@ -36,9 +39,15 @@ class GenerationCreateParams(TypedDict, total=False):
3639
loop: bool
3740
"""Whether to loop the video"""
3841

42+
model: Literal["ray-1-6", "ray-2"]
43+
"""The model used for the generation"""
44+
3945
prompt: str
4046
"""The prompt of the generation"""
4147

48+
resolution: Union[Literal["540p", "720p"], str]
49+
"""The resolution of the generation"""
50+
4251

4352
class KeyframesFrame0GenerationReference(TypedDict, total=False):
4453
id: Required[str]

src/lumaai/types/generations/video_create_params.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ class VideoCreateParams(TypedDict, total=False):
2828
failed
2929
"""
3030

31+
duration: Union[Literal["5s", "9s"], str]
32+
"""The duration of the generation"""
33+
3134
generation_type: Literal["video"]
3235

3336
keyframes: Keyframes
@@ -36,9 +39,15 @@ class VideoCreateParams(TypedDict, total=False):
3639
loop: bool
3740
"""Whether to loop the video"""
3841

42+
model: Literal["ray-1-6", "ray-2"]
43+
"""The model used for the generation"""
44+
3945
prompt: str
4046
"""The prompt of the generation"""
4147

48+
resolution: Union[Literal["540p", "720p"], str]
49+
"""The resolution of the generation"""
50+
4251

4352
class KeyframesFrame0GenerationReference(TypedDict, total=False):
4453
id: Required[str]

tests/api_resources/generations/test_video.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def test_method_create_with_all_params(self, client: LumaAI) -> None:
2727
video = client.generations.video.create(
2828
aspect_ratio="1:1",
2929
callback_url="https://example.com",
30+
duration="5s",
3031
generation_type="video",
3132
keyframes={
3233
"frame0": {
@@ -39,7 +40,9 @@ def test_method_create_with_all_params(self, client: LumaAI) -> None:
3940
},
4041
},
4142
loop=True,
43+
model="ray-1-6",
4244
prompt="A serene lake surrounded by mountains at sunset",
45+
resolution="540p",
4346
)
4447
assert_matches_type(Generation, video, path=["response"])
4548

@@ -77,6 +80,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncLumaAI) ->
7780
video = await async_client.generations.video.create(
7881
aspect_ratio="1:1",
7982
callback_url="https://example.com",
83+
duration="5s",
8084
generation_type="video",
8185
keyframes={
8286
"frame0": {
@@ -89,7 +93,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncLumaAI) ->
8993
},
9094
},
9195
loop=True,
96+
model="ray-1-6",
9297
prompt="A serene lake surrounded by mountains at sunset",
98+
resolution="540p",
9399
)
94100
assert_matches_type(Generation, video, path=["response"])
95101

tests/api_resources/test_generations.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def test_method_create_with_all_params(self, client: LumaAI) -> None:
2727
generation = client.generations.create(
2828
aspect_ratio="1:1",
2929
callback_url="https://example.com",
30+
duration="5s",
3031
generation_type="video",
3132
keyframes={
3233
"frame0": {
@@ -39,7 +40,9 @@ def test_method_create_with_all_params(self, client: LumaAI) -> None:
3940
},
4041
},
4142
loop=True,
43+
model="ray-1-6",
4244
prompt="A serene lake surrounded by mountains at sunset",
45+
resolution="540p",
4346
)
4447
assert_matches_type(Generation, generation, path=["response"])
4548

@@ -186,6 +189,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncLumaAI) ->
186189
generation = await async_client.generations.create(
187190
aspect_ratio="1:1",
188191
callback_url="https://example.com",
192+
duration="5s",
189193
generation_type="video",
190194
keyframes={
191195
"frame0": {
@@ -198,7 +202,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncLumaAI) ->
198202
},
199203
},
200204
loop=True,
205+
model="ray-1-6",
201206
prompt="A serene lake surrounded by mountains at sunset",
207+
resolution="540p",
202208
)
203209
assert_matches_type(Generation, generation, path=["response"])
204210

0 commit comments

Comments
 (0)