Skip to content

Commit 8b89fa6

Browse files
release: 0.17.0 (#43)
Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 0b5d8c3 commit 8b89fa6

File tree

12 files changed

+49
-290
lines changed

12 files changed

+49
-290
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-
".": "0.16.0"
2+
".": "0.17.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 18
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/premai%2Fpremai-25d63a01824adb74eba6e672fea1205184b5ed7105af5be98dc0b8e45bc65fad.yml
3-
openapi_spec_hash: b0c6d81a06eb23d7f31d3074afad7b2d
4-
config_hash: 4c4b619097d71f725c588da6ada0a0f5
1+
configured_endpoints: 17
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/premai%2Fpremai-d71329d1d7714d540c1a90fdb5178337061b3a73cb691a24b8869c25d4f0abcb.yml
3+
openapi_spec_hash: 9530f7daf03545cd24167b1adcb03f50
4+
config_hash: a84721ef021ce1dbb70854ae5ff9d7c5

CHANGELOG.md

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

3+
## 0.17.0 (2025-11-12)
4+
5+
Full Changelog: [v0.16.0...v0.17.0](https://github.com/premAI-io/prem-py-sdk/compare/v0.16.0...v0.17.0)
6+
7+
### Features
8+
9+
* **api:** api update ([739a8d7](https://github.com/premAI-io/prem-py-sdk/commit/739a8d7fa6b045c6e9c30fd7510245772344d50a))
10+
311
## 0.16.0 (2025-11-12)
412

513
Full Changelog: [v0.15.4...v0.16.0](https://github.com/premAI-io/prem-py-sdk/compare/v0.15.4...v0.16.0)

api.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,12 @@ Methods:
6969
Types:
7070

7171
```python
72-
from premai.types import SnapshotCreateResponse, SnapshotCreateFromFilesResponse
72+
from premai.types import SnapshotCreateResponse
7373
```
7474

7575
Methods:
7676

7777
- <code title="post /api/v1/public/snapshots/create">client.snapshots.<a href="./src/premai/resources/snapshots.py">create</a>(\*\*<a href="src/premai/types/snapshot_create_params.py">params</a>) -> <a href="./src/premai/types/snapshot_create_response.py">SnapshotCreateResponse</a></code>
78-
- <code title="post /api/v1/public/snapshots/create-from-files">client.snapshots.<a href="./src/premai/resources/snapshots.py">create_from_files</a>(\*\*<a href="src/premai/types/snapshot_create_from_files_params.py">params</a>) -> <a href="./src/premai/types/snapshot_create_from_files_response.py">SnapshotCreateFromFilesResponse</a></code>
7978

8079
# Recommendations
8180

pyproject.toml

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

src/premai/_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__ = "premai"
4-
__version__ = "0.16.0" # x-release-please-version
4+
__version__ = "0.17.0" # x-release-please-version

src/premai/resources/snapshots.py

Lines changed: 3 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22

33
from __future__ import annotations
44

5-
from typing import Mapping, cast
6-
75
import httpx
86

9-
from ..types import snapshot_create_params, snapshot_create_from_files_params
10-
from .._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given
11-
from .._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
7+
from ..types import snapshot_create_params
8+
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
9+
from .._utils import maybe_transform, async_maybe_transform
1210
from .._compat import cached_property
1311
from .._resource import SyncAPIResource, AsyncAPIResource
1412
from .._response import (
@@ -19,7 +17,6 @@
1917
)
2018
from .._base_client import make_request_options
2119
from ..types.snapshot_create_response import SnapshotCreateResponse
22-
from ..types.snapshot_create_from_files_response import SnapshotCreateFromFilesResponse
2320

2421
__all__ = ["SnapshotsResource", "AsyncSnapshotsResource"]
2522

@@ -88,65 +85,6 @@ def create(
8885
cast_to=SnapshotCreateResponse,
8986
)
9087

91-
def create_from_files(
92-
self,
93-
*,
94-
label: str,
95-
project_id: str,
96-
training_file: FileTypes,
97-
validation_file: FileTypes,
98-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
99-
# The extra values given here take precedence over values defined on the client or passed to this method.
100-
extra_headers: Headers | None = None,
101-
extra_query: Query | None = None,
102-
extra_body: Body | None = None,
103-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
104-
) -> SnapshotCreateFromFilesResponse:
105-
"""
106-
Create snapshot from separate training and validation files
107-
108-
Args:
109-
label: Snapshot name shown in the dashboard once the snapshot is created.
110-
111-
project_id: Project ID that will own the generated snapshot. Must match an existing project.
112-
113-
training_file: Required JSONL training file. Upload line-delimited messages that will form the
114-
training split.
115-
116-
validation_file: Required JSONL validation file. Upload line-delimited messages reserved for
117-
validation.
118-
119-
extra_headers: Send extra headers
120-
121-
extra_query: Add additional query parameters to the request
122-
123-
extra_body: Add additional JSON properties to the request
124-
125-
timeout: Override the client-level default timeout for this request, in seconds
126-
"""
127-
body = deepcopy_minimal(
128-
{
129-
"label": label,
130-
"project_id": project_id,
131-
"training_file": training_file,
132-
"validation_file": validation_file,
133-
}
134-
)
135-
files = extract_files(cast(Mapping[str, object], body), paths=[["training_file"], ["validation_file"]])
136-
# It should be noted that the actual Content-Type header that will be
137-
# sent to the server will contain a `boundary` parameter, e.g.
138-
# multipart/form-data; boundary=---abc--
139-
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
140-
return self._post(
141-
"/api/v1/public/snapshots/create-from-files",
142-
body=maybe_transform(body, snapshot_create_from_files_params.SnapshotCreateFromFilesParams),
143-
files=files,
144-
options=make_request_options(
145-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
146-
),
147-
cast_to=SnapshotCreateFromFilesResponse,
148-
)
149-
15088

15189
class AsyncSnapshotsResource(AsyncAPIResource):
15290
@cached_property
@@ -212,65 +150,6 @@ async def create(
212150
cast_to=SnapshotCreateResponse,
213151
)
214152

215-
async def create_from_files(
216-
self,
217-
*,
218-
label: str,
219-
project_id: str,
220-
training_file: FileTypes,
221-
validation_file: FileTypes,
222-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
223-
# The extra values given here take precedence over values defined on the client or passed to this method.
224-
extra_headers: Headers | None = None,
225-
extra_query: Query | None = None,
226-
extra_body: Body | None = None,
227-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
228-
) -> SnapshotCreateFromFilesResponse:
229-
"""
230-
Create snapshot from separate training and validation files
231-
232-
Args:
233-
label: Snapshot name shown in the dashboard once the snapshot is created.
234-
235-
project_id: Project ID that will own the generated snapshot. Must match an existing project.
236-
237-
training_file: Required JSONL training file. Upload line-delimited messages that will form the
238-
training split.
239-
240-
validation_file: Required JSONL validation file. Upload line-delimited messages reserved for
241-
validation.
242-
243-
extra_headers: Send extra headers
244-
245-
extra_query: Add additional query parameters to the request
246-
247-
extra_body: Add additional JSON properties to the request
248-
249-
timeout: Override the client-level default timeout for this request, in seconds
250-
"""
251-
body = deepcopy_minimal(
252-
{
253-
"label": label,
254-
"project_id": project_id,
255-
"training_file": training_file,
256-
"validation_file": validation_file,
257-
}
258-
)
259-
files = extract_files(cast(Mapping[str, object], body), paths=[["training_file"], ["validation_file"]])
260-
# It should be noted that the actual Content-Type header that will be
261-
# sent to the server will contain a `boundary` parameter, e.g.
262-
# multipart/form-data; boundary=---abc--
263-
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
264-
return await self._post(
265-
"/api/v1/public/snapshots/create-from-files",
266-
body=await async_maybe_transform(body, snapshot_create_from_files_params.SnapshotCreateFromFilesParams),
267-
files=files,
268-
options=make_request_options(
269-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
270-
),
271-
cast_to=SnapshotCreateFromFilesResponse,
272-
)
273-
274153

275154
class SnapshotsResourceWithRawResponse:
276155
def __init__(self, snapshots: SnapshotsResource) -> None:
@@ -279,9 +158,6 @@ def __init__(self, snapshots: SnapshotsResource) -> None:
279158
self.create = to_raw_response_wrapper(
280159
snapshots.create,
281160
)
282-
self.create_from_files = to_raw_response_wrapper(
283-
snapshots.create_from_files,
284-
)
285161

286162

287163
class AsyncSnapshotsResourceWithRawResponse:
@@ -291,9 +167,6 @@ def __init__(self, snapshots: AsyncSnapshotsResource) -> None:
291167
self.create = async_to_raw_response_wrapper(
292168
snapshots.create,
293169
)
294-
self.create_from_files = async_to_raw_response_wrapper(
295-
snapshots.create_from_files,
296-
)
297170

298171

299172
class SnapshotsResourceWithStreamingResponse:
@@ -303,9 +176,6 @@ def __init__(self, snapshots: SnapshotsResource) -> None:
303176
self.create = to_streamed_response_wrapper(
304177
snapshots.create,
305178
)
306-
self.create_from_files = to_streamed_response_wrapper(
307-
snapshots.create_from_files,
308-
)
309179

310180

311181
class AsyncSnapshotsResourceWithStreamingResponse:
@@ -315,6 +185,3 @@ def __init__(self, snapshots: AsyncSnapshotsResource) -> None:
315185
self.create = async_to_streamed_response_wrapper(
316186
snapshots.create,
317187
)
318-
self.create_from_files = async_to_streamed_response_wrapper(
319-
snapshots.create_from_files,
320-
)

src/premai/types/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,4 @@
2929
from .dataset_create_from_jsonl_params import DatasetCreateFromJSONLParams as DatasetCreateFromJSONLParams
3030
from .recommendation_generate_response import RecommendationGenerateResponse as RecommendationGenerateResponse
3131
from .dataset_create_synthetic_response import DatasetCreateSyntheticResponse as DatasetCreateSyntheticResponse
32-
from .snapshot_create_from_files_params import SnapshotCreateFromFilesParams as SnapshotCreateFromFilesParams
3332
from .dataset_create_from_jsonl_response import DatasetCreateFromJSONLResponse as DatasetCreateFromJSONLResponse
34-
from .snapshot_create_from_files_response import SnapshotCreateFromFilesResponse as SnapshotCreateFromFilesResponse

src/premai/types/recommendation_get_response.py

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,64 @@
33
from typing import List, Optional
44
from typing_extensions import Literal
55

6-
from pydantic import Field as FieldInfo
7-
86
from .._models import BaseModel
97

108
__all__ = [
119
"RecommendationGetResponse",
10+
"RecommendedExperiment",
1211
"RecommendedModel",
1312
"RecommendedModelFullHyperparameters",
1413
"RecommendedModelLoraHyperparameters",
1514
]
1615

1716

17+
class RecommendedExperiment(BaseModel):
18+
base_model_id: str
19+
20+
batch_size: int
21+
22+
learning_rate_multiplier: float
23+
24+
lora: bool
25+
26+
n_epochs: int
27+
28+
reason_for_recommendation: Optional[str] = None
29+
30+
recommended: bool
31+
32+
1833
class RecommendedModelFullHyperparameters(BaseModel):
19-
batch_size: int = FieldInfo(alias="batchSize")
34+
batch_size: int
2035

21-
learning_rate_multiplier: float = FieldInfo(alias="learningRateMultiplier")
36+
learning_rate_multiplier: float
2237

23-
n_epochs: int = FieldInfo(alias="nEpochs")
38+
n_epochs: int
2439

2540

2641
class RecommendedModelLoraHyperparameters(BaseModel):
27-
batch_size: int = FieldInfo(alias="batchSize")
42+
batch_size: int
2843

29-
learning_rate_multiplier: float = FieldInfo(alias="learningRateMultiplier")
44+
learning_rate_multiplier: float
3045

31-
n_epochs: int = FieldInfo(alias="nEpochs")
46+
n_epochs: int
3247

3348

3449
class RecommendedModel(BaseModel):
35-
base_model_id: str = FieldInfo(alias="baseModelId")
50+
base_model_id: str
3651

37-
full_hyperparameters: RecommendedModelFullHyperparameters
52+
full_hyperparameters: Optional[RecommendedModelFullHyperparameters] = None
3853

39-
lora_hyperparameters: RecommendedModelLoraHyperparameters
54+
lora_hyperparameters: Optional[RecommendedModelLoraHyperparameters] = None
4055

41-
reason_for_recommendation: Optional[str] = FieldInfo(alias="reasonForRecommendation", default=None)
56+
reason_for_recommendation: Optional[str] = None
4257

4358
recommended: bool
4459

4560

4661
class RecommendationGetResponse(BaseModel):
62+
recommended_experiments: Optional[List[RecommendedExperiment]] = None
63+
4764
recommended_models: Optional[List[RecommendedModel]] = None
4865

4966
snapshot_id: str

src/premai/types/snapshot_create_from_files_params.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)