runapi-luma 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {runapi_luma-0.2.0 → runapi_luma-0.3.0}/PKG-INFO +8 -8
- {runapi_luma-0.2.0 → runapi_luma-0.3.0}/README.md +3 -3
- {runapi_luma-0.2.0 → runapi_luma-0.3.0}/pyproject.toml +4 -4
- {runapi_luma-0.2.0 → runapi_luma-0.3.0}/src/runapi/luma/resources/modify_video.py +0 -2
- {runapi_luma-0.2.0 → runapi_luma-0.3.0}/tests/test_client.py +5 -29
- runapi_luma-0.2.0/src/runapi/luma/contract_gen.py +0 -15
- {runapi_luma-0.2.0 → runapi_luma-0.3.0}/src/runapi/luma/__init__.py +0 -0
- {runapi_luma-0.2.0 → runapi_luma-0.3.0}/src/runapi/luma/client.py +0 -0
- {runapi_luma-0.2.0 → runapi_luma-0.3.0}/src/runapi/luma/py.typed +0 -0
- {runapi_luma-0.2.0 → runapi_luma-0.3.0}/src/runapi/luma/resources/__init__.py +0 -0
- {runapi_luma-0.2.0 → runapi_luma-0.3.0}/src/runapi/luma/types.py +0 -0
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: runapi-luma
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: RunAPI Luma SDK for video modification workflows in JavaScript, Python, Ruby, Go, Java, and PHP
|
|
5
5
|
Project-URL: Homepage, https://runapi.ai/models/luma
|
|
6
|
-
Project-URL: Documentation, https://runapi.ai/docs
|
|
6
|
+
Project-URL: Documentation, https://runapi.ai/docs/resources/sdks
|
|
7
7
|
Project-URL: Source, https://github.com/runapi-ai/luma-sdk
|
|
8
8
|
Project-URL: Issues, https://github.com/runapi-ai/luma-sdk/issues
|
|
9
9
|
Project-URL: Changelog, https://github.com/runapi-ai/luma-sdk/blob/main/CHANGELOG.md
|
|
10
|
-
Project-URL: Release Notes, https://github.com/runapi-ai/luma-sdk/releases/tag/python%2Fv0.
|
|
10
|
+
Project-URL: Release Notes, https://github.com/runapi-ai/luma-sdk/releases/tag/python%2Fv0.3.0
|
|
11
11
|
Author-email: RunAPI <contact@runapi.ai>
|
|
12
12
|
License-Expression: Apache-2.0
|
|
13
13
|
Keywords: api,golang,gradle,java,luma,luma-ai-api,maven,python,ruby,runapi,runapi-ai,sdk,text-to-video,typescript,video-api,video-generation
|
|
14
14
|
Requires-Python: >=3.9
|
|
15
|
-
Requires-Dist: runapi-core
|
|
15
|
+
Requires-Dist: runapi-core~=0.10.0
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
|
|
18
18
|
# Luma API Python SDK for RunAPI
|
|
19
19
|
|
|
20
20
|
The Luma Python SDK is the language-specific package for Luma on RunAPI. Use this package for video generation, animation, and video editing workflows when your application needs request bodies, task status lookup, and consistent RunAPI errors in Python.
|
|
21
21
|
|
|
22
|
-
This README is the Python package guide inside the public `luma-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/luma; for API reference, use https://runapi.ai/docs
|
|
22
|
+
This README is the Python package guide inside the public `luma-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/luma; for API reference, use https://runapi.ai/docs/api/luma/modify-video; for SDK docs, use https://runapi.ai/docs/resources/sdks.
|
|
23
23
|
|
|
24
24
|
## Install
|
|
25
25
|
|
|
@@ -64,8 +64,8 @@ Pass parameters as keyword arguments and catch the `runapi.luma` error classes w
|
|
|
64
64
|
## Links
|
|
65
65
|
|
|
66
66
|
- Model page: https://runapi.ai/models/luma
|
|
67
|
-
- SDK docs: https://runapi.ai/docs
|
|
68
|
-
- Product docs: https://runapi.ai/docs
|
|
67
|
+
- SDK docs: https://runapi.ai/docs/resources/sdks
|
|
68
|
+
- Product docs: https://runapi.ai/docs/api/luma/modify-video
|
|
69
69
|
- Pricing and rate limits: https://runapi.ai/models/luma
|
|
70
70
|
- Provider comparison: https://runapi.ai/providers/luma
|
|
71
71
|
- Full catalog: https://runapi.ai/models
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The Luma Python SDK is the language-specific package for Luma on RunAPI. Use this package for video generation, animation, and video editing workflows when your application needs request bodies, task status lookup, and consistent RunAPI errors in Python.
|
|
4
4
|
|
|
5
|
-
This README is the Python package guide inside the public `luma-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/luma; for API reference, use https://runapi.ai/docs
|
|
5
|
+
This README is the Python package guide inside the public `luma-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/luma; for API reference, use https://runapi.ai/docs/api/luma/modify-video; for SDK docs, use https://runapi.ai/docs/resources/sdks.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -47,8 +47,8 @@ Pass parameters as keyword arguments and catch the `runapi.luma` error classes w
|
|
|
47
47
|
## Links
|
|
48
48
|
|
|
49
49
|
- Model page: https://runapi.ai/models/luma
|
|
50
|
-
- SDK docs: https://runapi.ai/docs
|
|
51
|
-
- Product docs: https://runapi.ai/docs
|
|
50
|
+
- SDK docs: https://runapi.ai/docs/resources/sdks
|
|
51
|
+
- Product docs: https://runapi.ai/docs/api/luma/modify-video
|
|
52
52
|
- Pricing and rate limits: https://runapi.ai/models/luma
|
|
53
53
|
- Provider comparison: https://runapi.ai/providers/luma
|
|
54
54
|
- Full catalog: https://runapi.ai/models
|
|
@@ -4,22 +4,22 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "runapi-luma"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.3.0"
|
|
8
8
|
description = "RunAPI Luma SDK for video modification workflows in JavaScript, Python, Ruby, Go, Java, and PHP"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
11
11
|
license = "Apache-2.0"
|
|
12
12
|
authors = [{ name = "RunAPI", email = "contact@runapi.ai" }]
|
|
13
13
|
keywords = ["runapi", "runapi-ai", "luma", "api", "sdk", "typescript", "python", "ruby", "golang", "java", "maven", "gradle", "video-generation", "text-to-video", "video-api", "luma-ai-api"]
|
|
14
|
-
dependencies = ["runapi-core
|
|
14
|
+
dependencies = ["runapi-core~=0.10.0"]
|
|
15
15
|
|
|
16
16
|
[project.urls]
|
|
17
17
|
Homepage = "https://runapi.ai/models/luma"
|
|
18
|
-
Documentation = "https://runapi.ai/docs
|
|
18
|
+
Documentation = "https://runapi.ai/docs/resources/sdks"
|
|
19
19
|
Source = "https://github.com/runapi-ai/luma-sdk"
|
|
20
20
|
Issues = "https://github.com/runapi-ai/luma-sdk/issues"
|
|
21
21
|
Changelog = "https://github.com/runapi-ai/luma-sdk/blob/main/CHANGELOG.md"
|
|
22
|
-
"Release Notes" = "https://github.com/runapi-ai/luma-sdk/releases/tag/python%2Fv0.
|
|
22
|
+
"Release Notes" = "https://github.com/runapi-ai/luma-sdk/releases/tag/python%2Fv0.3.0"
|
|
23
23
|
|
|
24
24
|
[tool.hatch.build.targets.wheel]
|
|
25
25
|
packages = ["src/runapi"]
|
|
@@ -6,7 +6,6 @@ from typing import Any, Optional
|
|
|
6
6
|
|
|
7
7
|
from runapi.core import Resource, RequestOptions
|
|
8
8
|
|
|
9
|
-
from ..contract_gen import CONTRACT
|
|
10
9
|
from ..types import CompletedModifyVideoResponse, ModifyVideoResponse
|
|
11
10
|
|
|
12
11
|
|
|
@@ -26,7 +25,6 @@ class ModifyVideo(Resource):
|
|
|
26
25
|
def create(self, options: Optional[RequestOptions] = None, **params: Any) -> Any:
|
|
27
26
|
"""Create a modify-video task and return immediately with an ``id``."""
|
|
28
27
|
compacted = self._compact_params(params)
|
|
29
|
-
self._validate_contract(CONTRACT["modify-video"], compacted)
|
|
30
28
|
return self._request("post", self.ENDPOINT, body=compacted, options=options)
|
|
31
29
|
|
|
32
30
|
def get(self, id: str, options: Optional[RequestOptions] = None) -> Any:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import pytest
|
|
2
2
|
|
|
3
3
|
from runapi.core import config
|
|
4
|
-
from runapi.core.errors import AuthenticationError
|
|
4
|
+
from runapi.core.errors import AuthenticationError
|
|
5
5
|
from runapi.luma import LumaClient
|
|
6
6
|
from runapi.luma.resources.modify_video import ModifyVideo
|
|
7
7
|
from runapi.luma.types import CompletedModifyVideoResponse, ModifyVideoResponse
|
|
@@ -83,10 +83,8 @@ def test_create_posts_compacted_body():
|
|
|
83
83
|
{
|
|
84
84
|
"model": "luma-modify-video",
|
|
85
85
|
"prompt": "hello",
|
|
86
|
-
"source_video_url": "https://cdn.runapi.ai/public/samples/video.mp4",
|
|
87
|
-
|
|
88
|
-
),
|
|
89
|
-
]
|
|
86
|
+
"source_video_url": "https://cdn.runapi.ai/public/samples/video.mp4"},
|
|
87
|
+
)]
|
|
90
88
|
assert isinstance(result, ModifyVideoResponse)
|
|
91
89
|
assert result.id == "t1"
|
|
92
90
|
|
|
@@ -103,9 +101,8 @@ def test_run_polls_and_narrows_completed_type():
|
|
|
103
101
|
{"id": "t1", "status": "pending"},
|
|
104
102
|
{
|
|
105
103
|
"id": "t1",
|
|
106
|
-
"status": "completed",
|
|
107
|
-
"videos": [{"url": "https://x/y.mp4"}],
|
|
108
|
-
},
|
|
104
|
+
"status": "completed", "usage": {"cost": 0.05},
|
|
105
|
+
"videos": [{"url": "https://x/y.mp4"}]},
|
|
109
106
|
)
|
|
110
107
|
client = LumaClient(api_key="k", http_client=fake)
|
|
111
108
|
result = client.modify_video.run(
|
|
@@ -117,24 +114,3 @@ def test_run_polls_and_narrows_completed_type():
|
|
|
117
114
|
assert isinstance(result, CompletedModifyVideoResponse)
|
|
118
115
|
assert result.videos[0].url == "https://x/y.mp4"
|
|
119
116
|
assert [call[0] for call in fake.calls] == ["post", "get"]
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
# --- validation -----------------------------------------------------------
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
def test_create_requires_model():
|
|
126
|
-
client = LumaClient(api_key="k", http_client=FakeHttp())
|
|
127
|
-
with pytest.raises(ValidationError, match="model must be one of: luma-modify-video"):
|
|
128
|
-
client.modify_video.create(prompt="hi", source_video_url="https://cdn.runapi.ai/public/samples/source.mp4")
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
def test_create_requires_prompt():
|
|
132
|
-
client = LumaClient(api_key="k", http_client=FakeHttp())
|
|
133
|
-
with pytest.raises(ValidationError, match="prompt is required"):
|
|
134
|
-
client.modify_video.create(model="luma-modify-video", source_video_url="https://cdn.runapi.ai/public/samples/source.mp4")
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
def test_create_requires_source_video_url():
|
|
138
|
-
client = LumaClient(api_key="k", http_client=FakeHttp())
|
|
139
|
-
with pytest.raises(ValidationError, match="source_video_url is required"):
|
|
140
|
-
client.modify_video.create(model="luma-modify-video", prompt="hi")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|