Skip to content

Commit b4dfb3d

Browse files
feat: update deployments schemas to include volume versions
1 parent 8b138b5 commit b4dfb3d

8 files changed

Lines changed: 91 additions & 13 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 74
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-41003d5ea35fdc4ec5c03cd7933dc5fee020d818abb1ea71f1d20d767cce06a0.yml
3-
openapi_spec_hash: 651ade27191eb5ad232ec508418fe4cb
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-e5c92952e92ccb3c9c93ff9bcfe7ff7b781d30e459b16c6e7edc4dd19112ede1.yml
3+
openapi_spec_hash: 10014e35650093070d25bb2b0fc07640
44
config_hash: b66198d27b4d5c152688ff6cccfdeab5

src/together/resources/beta/jig/volumes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def create(
6161
Create a new volume to preload files in deployments
6262
6363
Args:
64-
content: Content specifies the content configuration for this volume
64+
content: Content specifies the new content that will be preloaded to this volume
6565
6666
name: Name is the unique identifier for the volume within the project
6767
@@ -270,7 +270,7 @@ async def create(
270270
Create a new volume to preload files in deployments
271271
272272
Args:
273-
content: Content specifies the content configuration for this volume
273+
content: Content specifies the new content that will be preloaded to this volume
274274
275275
name: Name is the unique identifier for the volume within the project
276276

src/together/types/beta/deployment.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ class Volume(BaseModel):
8888
Must reference an existing volume by name or ID
8989
"""
9090

91+
version: Optional[int] = None
92+
"""Version is the volume version to mount.
93+
94+
On create, defaults to the latest version. On update, defaults to the currently
95+
mounted version.
96+
"""
97+
9198

9299
class Deployment(BaseModel):
93100
id: Optional[str] = None
Lines changed: 60 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,46 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Optional
3+
from typing import Dict, List, Optional
44
from typing_extensions import Literal
55

66
from ...._models import BaseModel
77

8-
__all__ = ["Volume", "Content"]
8+
__all__ = ["Volume", "Content", "ContentFile", "VersionHistory", "VersionHistoryContent"]
9+
10+
11+
class ContentFile(BaseModel):
12+
last_modified: Optional[str] = None
13+
"""LastModified is the timestamp when the file was last modified"""
14+
15+
name: Optional[str] = None
16+
"""Name is the filename including extension (e.g., "model_weights.bin")"""
17+
18+
size: Optional[int] = None
19+
"""Size is the file size in bytes"""
920

1021

1122
class Content(BaseModel):
12-
"""Content specifies the content that will be preloaded to this volume"""
23+
files: Optional[List[ContentFile]] = None
24+
"""
25+
Files is the list of files that will be preloaded into the volume, if the volume
26+
content type is "files"
27+
"""
28+
29+
source_prefix: Optional[str] = None
30+
"""
31+
SourcePrefix is the file path prefix for the content to be preloaded into the
32+
volume
33+
"""
34+
35+
type: Optional[Literal["files"]] = None
36+
"""
37+
Type is the content type (currently only "files" is supported which allows
38+
preloading files uploaded via Files API into the volume)
39+
"""
40+
41+
42+
class VersionHistoryContent(BaseModel):
43+
"""Content specifies the new content that will be preloaded to this volume"""
1344

1445
source_prefix: Optional[str] = None
1546
"""
@@ -24,24 +55,46 @@ class Content(BaseModel):
2455
"""
2556

2657

58+
class VersionHistory(BaseModel):
59+
content: Optional[VersionHistoryContent] = None
60+
"""Content specifies the new content that will be preloaded to this volume"""
61+
62+
mounted_by: Optional[List[str]] = None
63+
64+
version: Optional[int] = None
65+
66+
2767
class Volume(BaseModel):
2868
id: Optional[str] = None
2969
"""ID is the unique identifier for this volume"""
3070

3171
content: Optional[Content] = None
32-
"""Content specifies the content that will be preloaded to this volume"""
3372

3473
created_at: Optional[str] = None
3574
"""CreatedAt is the ISO8601 timestamp when this volume was created"""
3675

76+
current_version: Optional[int] = None
77+
"""CurrentVersion is the current version number of this volume"""
78+
79+
mounted_by: Optional[List[str]] = None
80+
"""
81+
MountedBy is the list of deployment IDs currently mounting current volume
82+
version
83+
"""
84+
3785
name: Optional[str] = None
3886
"""Name is the name of the volume"""
3987

40-
object: Optional[Literal["volume"]] = None
41-
"""The object type, which is always `volume`."""
88+
object: Optional[str] = None
89+
"""Object is the type identifier for this response (always "volume")"""
4290

4391
type: Optional[Literal["readOnly"]] = None
44-
"""Type is the volume type (e.g., "readOnly")"""
4592

4693
updated_at: Optional[str] = None
4794
"""UpdatedAt is the ISO8601 timestamp when this volume was last updated"""
95+
96+
version_history: Optional[Dict[str, VersionHistory]] = None
97+
"""
98+
VersionHistory contains previous versions of this volume, keyed by version
99+
number
100+
"""

src/together/types/beta/jig/volume_create_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class VolumeCreateParams(TypedDict, total=False):
1111
content: Required[Content]
12-
"""Content specifies the content configuration for this volume"""
12+
"""Content specifies the new content that will be preloaded to this volume"""
1313

1414
name: Required[str]
1515
"""Name is the unique identifier for the volume within the project"""
@@ -19,7 +19,7 @@ class VolumeCreateParams(TypedDict, total=False):
1919

2020

2121
class Content(TypedDict, total=False):
22-
"""Content specifies the content configuration for this volume"""
22+
"""Content specifies the new content that will be preloaded to this volume"""
2323

2424
source_prefix: str
2525
"""

src/together/types/beta/jig_deploy_params.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,10 @@ class Volume(TypedDict, total=False):
148148
149149
Must reference an existing volume by name or ID
150150
"""
151+
152+
version: int
153+
"""Version is the volume version to mount.
154+
155+
On create, defaults to the latest version. On update, defaults to the currently
156+
mounted version.
157+
"""

src/together/types/beta/jig_update_params.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,10 @@ class Volume(TypedDict, total=False):
139139
140140
Must reference an existing volume by name or ID
141141
"""
142+
143+
version: int
144+
"""Version is the volume version to mount.
145+
146+
On create, defaults to the latest version. On update, defaults to the currently
147+
mounted version.
148+
"""

tests/api_resources/beta/test_jig.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ def test_method_update_with_all_params(self, client: Together) -> None:
9797
{
9898
"mount_path": "mount_path",
9999
"name": "name",
100+
"version": 0,
100101
}
101102
],
102103
)
@@ -197,6 +198,7 @@ def test_method_deploy_with_all_params(self, client: Together) -> None:
197198
{
198199
"mount_path": "mount_path",
199200
"name": "name",
201+
"version": 0,
200202
}
201203
],
202204
)
@@ -396,6 +398,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncTogether)
396398
{
397399
"mount_path": "mount_path",
398400
"name": "name",
401+
"version": 0,
399402
}
400403
],
401404
)
@@ -496,6 +499,7 @@ async def test_method_deploy_with_all_params(self, async_client: AsyncTogether)
496499
{
497500
"mount_path": "mount_path",
498501
"name": "name",
502+
"version": 0,
499503
}
500504
],
501505
)

0 commit comments

Comments
 (0)