Skip to content

Commit 9305f8d

Browse files
authored
Merge pull request #110 from lumalabs/release-please--branches--main--changes--next
release: 1.5.0
2 parents 0754774 + f44f494 commit 9305f8d

File tree

15 files changed

+273
-16
lines changed

15 files changed

+273
-16
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.4.1"
2+
".": "1.5.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 8
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/luma-ai-karanganesan%2Fluma_ai-7514d44d25b8dd931de982d593ba0d03467acdda95fc8367ef2732e7ad2e8086.yml
1+
configured_endpoints: 9
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/luma-ai-karanganesan%2Fluma_ai-5dbcb84a385ed55016c4d7ded7c0056e6e537b19fd3b626179a2c4c9bac8a90f.yml

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## 1.5.0 (2025-02-22)
4+
5+
Full Changelog: [v1.4.1...v1.5.0](https://github.com/lumalabs/lumaai-python/compare/v1.4.1...v1.5.0)
6+
7+
### Features
8+
9+
* **api:** api update ([#111](https://github.com/lumalabs/lumaai-python/issues/111)) ([4db81fc](https://github.com/lumalabs/lumaai-python/commit/4db81fc9a3a4c4440e509e601e618c808de8145f))
10+
* **client:** allow passing `NotGiven` for body ([#109](https://github.com/lumalabs/lumaai-python/issues/109)) ([75d1543](https://github.com/lumalabs/lumaai-python/commit/75d15435597671ccf955f685428b9873c26bae9d))
11+
12+
13+
### Bug Fixes
14+
15+
* **client:** mark some request bodies as optional ([75d1543](https://github.com/lumalabs/lumaai-python/commit/75d15435597671ccf955f685428b9873c26bae9d))
16+
317
## 1.4.1 (2025-02-14)
418

519
Full Changelog: [v1.4.0...v1.4.1](https://github.com/lumalabs/lumaai-python/compare/v1.4.0...v1.4.1)

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Methods:
1212
- <code title="get /generations">client.generations.<a href="./src/lumaai/resources/generations/generations.py">list</a>(\*\*<a href="src/lumaai/types/generation_list_params.py">params</a>) -> <a href="./src/lumaai/types/generation_list_response.py">GenerationListResponse</a></code>
1313
- <code title="delete /generations/{id}">client.generations.<a href="./src/lumaai/resources/generations/generations.py">delete</a>(id) -> None</code>
1414
- <code title="get /generations/{id}">client.generations.<a href="./src/lumaai/resources/generations/generations.py">get</a>(id) -> <a href="./src/lumaai/types/generation.py">Generation</a></code>
15+
- <code title="post /generations/{id}/upscale">client.generations.<a href="./src/lumaai/resources/generations/generations.py">upscale</a>(id, \*\*<a href="src/lumaai/types/generation_upscale_params.py">params</a>) -> <a href="./src/lumaai/types/generation.py">Generation</a></code>
1516

1617
## CameraMotion
1718

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "lumaai"
3-
version = "1.4.1"
3+
version = "1.5.0"
44
description = "The official Python library for the lumaai API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/lumaai/_base_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def _build_request(
518518
# so that passing a `TypedDict` doesn't cause an error.
519519
# https://github.com/microsoft/pyright/issues/3526#event-6715453066
520520
params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None,
521-
json=json_data,
521+
json=json_data if is_given(json_data) else None,
522522
files=files,
523523
**kwargs,
524524
)

src/lumaai/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "lumaai"
4-
__version__ = "1.4.1" # x-release-please-version
4+
__version__ = "1.5.0" # x-release-please-version

src/lumaai/resources/generations/generations.py

Lines changed: 111 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
VideoResourceWithStreamingResponse,
2424
AsyncVideoResourceWithStreamingResponse,
2525
)
26-
from ...types import generation_list_params, generation_create_params
26+
from ...types import generation_list_params, generation_create_params, generation_upscale_params
2727
from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
2828
from ..._utils import (
2929
maybe_transform,
@@ -95,7 +95,7 @@ def create(
9595
loop: bool | NotGiven = NOT_GIVEN,
9696
model: Literal["ray-1-6", "ray-2"] | NotGiven = NOT_GIVEN,
9797
prompt: str | NotGiven = NOT_GIVEN,
98-
resolution: Union[Literal["540p", "720p"], str] | NotGiven = NOT_GIVEN,
98+
resolution: Union[Literal["540p", "720p", "1080p", "4k"], str] | NotGiven = NOT_GIVEN,
9999
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
100100
# The extra values given here take precedence over values defined on the client or passed to this method.
101101
extra_headers: Headers | None = None,
@@ -264,6 +264,54 @@ def get(
264264
cast_to=Generation,
265265
)
266266

267+
def upscale(
268+
self,
269+
id: str,
270+
*,
271+
callback_url: str | NotGiven = NOT_GIVEN,
272+
generation_type: Literal["upscale_video"] | NotGiven = NOT_GIVEN,
273+
resolution: Union[Literal["540p", "720p", "1080p", "4k"], str] | NotGiven = NOT_GIVEN,
274+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
275+
# The extra values given here take precedence over values defined on the client or passed to this method.
276+
extra_headers: Headers | None = None,
277+
extra_query: Query | None = None,
278+
extra_body: Body | None = None,
279+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
280+
) -> Generation:
281+
"""
282+
Upscale a generation by its ID
283+
284+
Args:
285+
callback_url: The callback URL for the upscale
286+
287+
resolution: The resolution of the upscale
288+
289+
extra_headers: Send extra headers
290+
291+
extra_query: Add additional query parameters to the request
292+
293+
extra_body: Add additional JSON properties to the request
294+
295+
timeout: Override the client-level default timeout for this request, in seconds
296+
"""
297+
if not id:
298+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
299+
return self._post(
300+
f"/generations/{id}/upscale",
301+
body=maybe_transform(
302+
{
303+
"callback_url": callback_url,
304+
"generation_type": generation_type,
305+
"resolution": resolution,
306+
},
307+
generation_upscale_params.GenerationUpscaleParams,
308+
),
309+
options=make_request_options(
310+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
311+
),
312+
cast_to=Generation,
313+
)
314+
267315

268316
class AsyncGenerationsResource(AsyncAPIResource):
269317
@cached_property
@@ -308,7 +356,7 @@ async def create(
308356
loop: bool | NotGiven = NOT_GIVEN,
309357
model: Literal["ray-1-6", "ray-2"] | NotGiven = NOT_GIVEN,
310358
prompt: str | NotGiven = NOT_GIVEN,
311-
resolution: Union[Literal["540p", "720p"], str] | NotGiven = NOT_GIVEN,
359+
resolution: Union[Literal["540p", "720p", "1080p", "4k"], str] | NotGiven = NOT_GIVEN,
312360
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
313361
# The extra values given here take precedence over values defined on the client or passed to this method.
314362
extra_headers: Headers | None = None,
@@ -477,6 +525,54 @@ async def get(
477525
cast_to=Generation,
478526
)
479527

528+
async def upscale(
529+
self,
530+
id: str,
531+
*,
532+
callback_url: str | NotGiven = NOT_GIVEN,
533+
generation_type: Literal["upscale_video"] | NotGiven = NOT_GIVEN,
534+
resolution: Union[Literal["540p", "720p", "1080p", "4k"], str] | NotGiven = NOT_GIVEN,
535+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
536+
# The extra values given here take precedence over values defined on the client or passed to this method.
537+
extra_headers: Headers | None = None,
538+
extra_query: Query | None = None,
539+
extra_body: Body | None = None,
540+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
541+
) -> Generation:
542+
"""
543+
Upscale a generation by its ID
544+
545+
Args:
546+
callback_url: The callback URL for the upscale
547+
548+
resolution: The resolution of the upscale
549+
550+
extra_headers: Send extra headers
551+
552+
extra_query: Add additional query parameters to the request
553+
554+
extra_body: Add additional JSON properties to the request
555+
556+
timeout: Override the client-level default timeout for this request, in seconds
557+
"""
558+
if not id:
559+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
560+
return await self._post(
561+
f"/generations/{id}/upscale",
562+
body=await async_maybe_transform(
563+
{
564+
"callback_url": callback_url,
565+
"generation_type": generation_type,
566+
"resolution": resolution,
567+
},
568+
generation_upscale_params.GenerationUpscaleParams,
569+
),
570+
options=make_request_options(
571+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
572+
),
573+
cast_to=Generation,
574+
)
575+
480576

481577
class GenerationsResourceWithRawResponse:
482578
def __init__(self, generations: GenerationsResource) -> None:
@@ -494,6 +590,9 @@ def __init__(self, generations: GenerationsResource) -> None:
494590
self.get = to_raw_response_wrapper(
495591
generations.get,
496592
)
593+
self.upscale = to_raw_response_wrapper(
594+
generations.upscale,
595+
)
497596

498597
@cached_property
499598
def camera_motion(self) -> CameraMotionResourceWithRawResponse:
@@ -524,6 +623,9 @@ def __init__(self, generations: AsyncGenerationsResource) -> None:
524623
self.get = async_to_raw_response_wrapper(
525624
generations.get,
526625
)
626+
self.upscale = async_to_raw_response_wrapper(
627+
generations.upscale,
628+
)
527629

528630
@cached_property
529631
def camera_motion(self) -> AsyncCameraMotionResourceWithRawResponse:
@@ -554,6 +656,9 @@ def __init__(self, generations: GenerationsResource) -> None:
554656
self.get = to_streamed_response_wrapper(
555657
generations.get,
556658
)
659+
self.upscale = to_streamed_response_wrapper(
660+
generations.upscale,
661+
)
557662

558663
@cached_property
559664
def camera_motion(self) -> CameraMotionResourceWithStreamingResponse:
@@ -584,6 +689,9 @@ def __init__(self, generations: AsyncGenerationsResource) -> None:
584689
self.get = async_to_streamed_response_wrapper(
585690
generations.get,
586691
)
692+
self.upscale = async_to_streamed_response_wrapper(
693+
generations.upscale,
694+
)
587695

588696
@cached_property
589697
def camera_motion(self) -> AsyncCameraMotionResourceWithStreamingResponse:

src/lumaai/resources/generations/video.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def create(
5858
loop: bool | NotGiven = NOT_GIVEN,
5959
model: Literal["ray-1-6", "ray-2"] | NotGiven = NOT_GIVEN,
6060
prompt: str | NotGiven = NOT_GIVEN,
61-
resolution: Union[Literal["540p", "720p"], str] | NotGiven = NOT_GIVEN,
61+
resolution: Union[Literal["540p", "720p", "1080p", "4k"], str] | NotGiven = NOT_GIVEN,
6262
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6363
# The extra values given here take precedence over values defined on the client or passed to this method.
6464
extra_headers: Headers | None = None,
@@ -150,7 +150,7 @@ async def create(
150150
loop: bool | NotGiven = NOT_GIVEN,
151151
model: Literal["ray-1-6", "ray-2"] | NotGiven = NOT_GIVEN,
152152
prompt: str | NotGiven = NOT_GIVEN,
153-
resolution: Union[Literal["540p", "720p"], str] | NotGiven = NOT_GIVEN,
153+
resolution: Union[Literal["540p", "720p", "1080p", "4k"], str] | NotGiven = NOT_GIVEN,
154154
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
155155
# The extra values given here take precedence over values defined on the client or passed to this method.
156156
extra_headers: Headers | None = None,

src/lumaai/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
from .generation_list_params import GenerationListParams as GenerationListParams
99
from .generation_create_params import GenerationCreateParams as GenerationCreateParams
1010
from .generation_list_response import GenerationListResponse as GenerationListResponse
11+
from .generation_upscale_params import GenerationUpscaleParams as GenerationUpscaleParams

0 commit comments

Comments
 (0)