runapi-seedream 0.2.3__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.
@@ -1,18 +1,18 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: runapi-seedream
3
- Version: 0.2.3
3
+ Version: 0.3.0
4
4
  Summary: RunAPI Seedream SDK for text-to-image and edit-image workflows in JavaScript, Python, Ruby, Go, Java, and PHP
5
5
  Project-URL: Homepage, https://runapi.ai/models/seedream
6
6
  Project-URL: Documentation, https://runapi.ai/docs/resources/sdks
7
7
  Project-URL: Source, https://github.com/runapi-ai/seedream-sdk
8
8
  Project-URL: Issues, https://github.com/runapi-ai/seedream-sdk/issues
9
9
  Project-URL: Changelog, https://github.com/runapi-ai/seedream-sdk/blob/main/CHANGELOG.md
10
- Project-URL: Release Notes, https://github.com/runapi-ai/seedream-sdk/releases/tag/python%2Fv0.2.3
10
+ Project-URL: Release Notes, https://github.com/runapi-ai/seedream-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,image-api,image-generation,java,maven,python,ruby,runapi,runapi-ai,sdk,seedream,seedream-api,text-to-image,typescript
14
14
  Requires-Python: >=3.9
15
- Requires-Dist: runapi-core>=0.5.1
15
+ Requires-Dist: runapi-core>=0.8.0
16
16
  Description-Content-Type: text/markdown
17
17
 
18
18
  # Seedream Python SDK for RunAPI
@@ -4,14 +4,14 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "runapi-seedream"
7
- version = "0.2.3"
7
+ version = "0.3.0"
8
8
  description = "RunAPI Seedream SDK for text-to-image and edit-image 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", "seedream", "api", "sdk", "typescript", "python", "ruby", "golang", "java", "maven", "gradle", "image-generation", "text-to-image", "image-api", "seedream-api"]
14
- dependencies = ["runapi-core>=0.5.1"]
14
+ dependencies = ["runapi-core>=0.8.0"]
15
15
 
16
16
  [project.urls]
17
17
  Homepage = "https://runapi.ai/models/seedream"
@@ -19,7 +19,7 @@ Documentation = "https://runapi.ai/docs/resources/sdks"
19
19
  Source = "https://github.com/runapi-ai/seedream-sdk"
20
20
  Issues = "https://github.com/runapi-ai/seedream-sdk/issues"
21
21
  Changelog = "https://github.com/runapi-ai/seedream-sdk/blob/main/CHANGELOG.md"
22
- "Release Notes" = "https://github.com/runapi-ai/seedream-sdk/releases/tag/python%2Fv0.2.3"
22
+ "Release Notes" = "https://github.com/runapi-ai/seedream-sdk/releases/tag/python%2Fv0.3.0"
23
23
 
24
24
  [tool.hatch.build.targets.wheel]
25
25
  packages = ["src/runapi"]
@@ -18,6 +18,23 @@ class Image(BaseModel):
18
18
  url = optional(str)
19
19
 
20
20
 
21
+ class BoundingBox(BaseModel):
22
+ """Bounding box describing a layer's position within the base image."""
23
+
24
+ absolute = optional([int])
25
+ normalized = optional([int])
26
+
27
+
28
+ class Layer(BaseModel):
29
+ """A decomposed layer with its position and metadata."""
30
+
31
+ url = required(str)
32
+ z_index = required(int)
33
+ bounding_box = optional(lambda: BoundingBox)
34
+ name = optional(str)
35
+ description = optional(str)
36
+
37
+
21
38
  class TextToImageResponse(TaskResponse):
22
39
  """Seedream image task status response."""
23
40
 
@@ -45,7 +62,7 @@ class DecomposeLayersResponse(TaskResponse):
45
62
  id = required(str)
46
63
  status = optional(str, enum=lambda: TaskResponse.Status.ALL)
47
64
  base_image = optional(lambda: Image)
48
- layers = optional([lambda: Image])
65
+ layers = optional([lambda: Layer])
49
66
  error = optional(str)
50
67
 
51
68
 
@@ -53,4 +70,4 @@ class CompletedDecomposeLayersResponse(DecomposeLayersResponse):
53
70
  """Narrowed response once layer decomposition completes."""
54
71
 
55
72
  base_image = required(lambda: Image)
56
- layers = required([lambda: Image])
73
+ layers = required([lambda: Layer])
@@ -75,7 +75,7 @@ def test_decompose_layers_create_get_and_completed_response():
75
75
  "id": "layers-1",
76
76
  "status": "completed",
77
77
  "base_image": {"url": "https://file.runapi.ai/base.jpeg"},
78
- "layers": [{"url": "https://file.runapi.ai/layer.png"}],
78
+ "layers": [{"url": "https://file.runapi.ai/layer.png", "z_index": 1}],
79
79
  },
80
80
  )
81
81
  client = SeedreamClient(api_key="k", http_client=fake)