Skip to content

Commit 3f946ba

Browse files
Update clients to latest platform release (4.0.12) (#41)
Co-authored-by: Anand J <anandj@centml.ai>
1 parent b98fa49 commit 3f946ba

27 files changed

+276
-20
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ No description provided (generated by Openapi Generator https://github.com/opena
44
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
55

66
- API version: 0.1.0
7-
- Package version: 4.0.11
7+
- Package version: 4.0.12
88
- Generator version: 7.9.0
99
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
1010

@@ -163,6 +163,7 @@ Class | Method | HTTP request | Description
163163
- [DeploymentStatusRequest](docs/DeploymentStatusRequest.md)
164164
- [DeploymentStatusResponse](docs/DeploymentStatusResponse.md)
165165
- [DeploymentType](docs/DeploymentType.md)
166+
- [DeploymentUsage](docs/DeploymentUsage.md)
166167
- [DeploymentUsageValue](docs/DeploymentUsageValue.md)
167168
- [GetAutochargePreferencesResponse](docs/GetAutochargePreferencesResponse.md)
168169
- [GetCServeV2DeploymentResponse](docs/GetCServeV2DeploymentResponse.md)

docs/CreateCServeV2DeploymentRequest.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
99
**cluster_id** | **int** | |
1010
**hardware_instance_id** | **int** | |
1111
**recipe** | [**CServeV2Recipe**](CServeV2Recipe.md) | |
12+
**cserve_version** | **str** | | [optional]
1213
**hf_token** | **str** | | [optional]
1314
**endpoint_bearer_token** | **str** | | [optional]
1415
**endpoint_certificate_authority** | **str** | | [optional]

docs/CreateRagDeploymentRequest.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
99
**cluster_id** | **int** | |
1010
**hardware_instance_id** | **int** | |
1111
**recipe** | [**CServeV2Recipe**](CServeV2Recipe.md) | |
12+
**cserve_version** | **str** | | [optional]
1213
**hf_token** | **str** | | [optional]
1314
**llm_model** | **str** | |
1415
**centml_api_key** | **str** | |

docs/DeploymentUsage.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# DeploymentUsage
2+
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**metric** | **Dict[str, str]** | |
9+
**values** | [**List[DeploymentUsageValue]**](DeploymentUsageValue.md) | |
10+
11+
## Example
12+
13+
```python
14+
from platform_api_python_client.models.deployment_usage import DeploymentUsage
15+
16+
# TODO update the JSON string below
17+
json = "{}"
18+
# create an instance of DeploymentUsage from a JSON string
19+
deployment_usage_instance = DeploymentUsage.from_json(json)
20+
# print the JSON string representation of the object
21+
print(DeploymentUsage.to_json())
22+
23+
# convert the object into a dict
24+
deployment_usage_dict = deployment_usage_instance.to_dict()
25+
# create an instance of DeploymentUsage from a dict
26+
deployment_usage_from_dict = DeploymentUsage.from_dict(deployment_usage_dict)
27+
```
28+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
29+
30+

docs/GetCServeV2DeploymentResponse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Name | Type | Description | Notes
1515
**created_at** | **datetime** | |
1616
**hardware_instance_id** | **int** | |
1717
**recipe** | [**CServeV2Recipe**](CServeV2Recipe.md) | |
18+
**cserve_version** | **str** | | [optional]
1819
**min_scale** | **int** | |
1920
**max_scale** | **int** | |
2021
**initial_scale** | **int** | | [optional]

docs/GetDeploymentUsageResponse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
8-
**values** | [**List[DeploymentUsageValue]**](DeploymentUsageValue.md) | |
8+
**values** | [**List[DeploymentUsage]**](DeploymentUsage.md) | |
99

1010
## Example
1111

docs/GetRagDeploymentResponse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Name | Type | Description | Notes
1515
**created_at** | **datetime** | |
1616
**hardware_instance_id** | **int** | |
1717
**recipe** | [**CServeV2Recipe**](CServeV2Recipe.md) | |
18+
**cserve_version** | **str** | | [optional]
1819
**llm_model** | **str** | |
1920
**centml_api_key** | **str** | |
2021
**min_scale** | **int** | | [optional] [default to 1]

docs/Metric.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,20 @@
1111

1212
* `HTTP_REQUESTS` (value: `'http_requests'`)
1313

14+
* `HTTP_REQUESTS_BY_STATUS` (value: `'http_requests_by_status'`)
15+
16+
* `ERROR_CODE` (value: `'error_code'`)
17+
1418
* `REQUEST_LATENCY_50_PERCENTILE` (value: `'request_latency_50_percentile'`)
1519

1620
* `REQUEST_LATENCY_90_PERCENTILE` (value: `'request_latency_90_percentile'`)
1721

1822
* `REQUEST_LATENCY_99_PERCENTILE` (value: `'request_latency_99_percentile'`)
1923

24+
* `TOKENS_PER_SECOND` (value: `'tokens_per_second'`)
25+
26+
* `TIME_TO_FIRST_TOKEN` (value: `'time_to_first_token'`)
27+
2028
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
2129

2230

platform_api_python_client/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
""" # noqa: E501
1515

1616

17-
__version__ = "4.0.11"
17+
__version__ = "4.0.12"
1818

1919
# import apis into sdk package
2020
from platform_api_python_client.api.external_api import EXTERNALApi
@@ -55,6 +55,7 @@
5555
from platform_api_python_client.models.deployment_status_request import DeploymentStatusRequest
5656
from platform_api_python_client.models.deployment_status_response import DeploymentStatusResponse
5757
from platform_api_python_client.models.deployment_type import DeploymentType
58+
from platform_api_python_client.models.deployment_usage import DeploymentUsage
5859
from platform_api_python_client.models.deployment_usage_value import DeploymentUsageValue
5960
from platform_api_python_client.models.get_autocharge_preferences_response import GetAutochargePreferencesResponse
6061
from platform_api_python_client.models.get_c_serve_v2_deployment_response import GetCServeV2DeploymentResponse

platform_api_python_client/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def __init__(
9090
self.default_headers[header_name] = header_value
9191
self.cookie = cookie
9292
# Set default User-Agent.
93-
self.user_agent = 'OpenAPI-Generator/4.0.11/python'
93+
self.user_agent = 'OpenAPI-Generator/4.0.12/python'
9494
self.client_side_validation = configuration.client_side_validation
9595

9696
def __enter__(self):

platform_api_python_client/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def to_debug_report(self):
392392
"OS: {env}\n"\
393393
"Python Version: {pyversion}\n"\
394394
"Version of the API: 0.1.0\n"\
395-
"SDK Package Version: 4.0.11".\
395+
"SDK Package Version: 4.0.12".\
396396
format(env=sys.platform, pyversion=sys.version)
397397

398398
def get_host_settings(self):

platform_api_python_client/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
from platform_api_python_client.models.deployment_status_request import DeploymentStatusRequest
3939
from platform_api_python_client.models.deployment_status_response import DeploymentStatusResponse
4040
from platform_api_python_client.models.deployment_type import DeploymentType
41+
from platform_api_python_client.models.deployment_usage import DeploymentUsage
4142
from platform_api_python_client.models.deployment_usage_value import DeploymentUsageValue
4243
from platform_api_python_client.models.get_autocharge_preferences_response import GetAutochargePreferencesResponse
4344
from platform_api_python_client.models.get_c_serve_v2_deployment_response import GetCServeV2DeploymentResponse

platform_api_python_client/models/create_c_serve_v2_deployment_request.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class CreateCServeV2DeploymentRequest(BaseModel):
3232
cluster_id: StrictInt
3333
hardware_instance_id: StrictInt
3434
recipe: CServeV2Recipe
35+
cserve_version: Optional[StrictStr] = None
3536
hf_token: Optional[StrictStr] = None
3637
endpoint_bearer_token: Optional[StrictStr] = None
3738
endpoint_certificate_authority: Optional[StrictStr] = None
@@ -40,7 +41,7 @@ class CreateCServeV2DeploymentRequest(BaseModel):
4041
initial_scale: Optional[StrictInt] = None
4142
concurrency: Optional[StrictInt] = None
4243
env_vars: Optional[Dict[str, StrictStr]] = None
43-
__properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "recipe", "hf_token", "endpoint_bearer_token", "endpoint_certificate_authority", "min_scale", "max_scale", "initial_scale", "concurrency", "env_vars"]
44+
__properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "recipe", "cserve_version", "hf_token", "endpoint_bearer_token", "endpoint_certificate_authority", "min_scale", "max_scale", "initial_scale", "concurrency", "env_vars"]
4445

4546
@field_validator('name')
4647
def name_validate_regular_expression(cls, value):
@@ -91,6 +92,11 @@ def to_dict(self) -> Dict[str, Any]:
9192
# override the default output from pydantic by calling `to_dict()` of recipe
9293
if self.recipe:
9394
_dict['recipe'] = self.recipe.to_dict()
95+
# set to None if cserve_version (nullable) is None
96+
# and model_fields_set contains the field
97+
if self.cserve_version is None and "cserve_version" in self.model_fields_set:
98+
_dict['cserve_version'] = None
99+
94100
# set to None if hf_token (nullable) is None
95101
# and model_fields_set contains the field
96102
if self.hf_token is None and "hf_token" in self.model_fields_set:
@@ -132,6 +138,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
132138
"cluster_id": obj.get("cluster_id"),
133139
"hardware_instance_id": obj.get("hardware_instance_id"),
134140
"recipe": CServeV2Recipe.from_dict(obj["recipe"]) if obj.get("recipe") is not None else None,
141+
"cserve_version": obj.get("cserve_version"),
135142
"hf_token": obj.get("hf_token"),
136143
"endpoint_bearer_token": obj.get("endpoint_bearer_token"),
137144
"endpoint_certificate_authority": obj.get("endpoint_certificate_authority"),

platform_api_python_client/models/create_rag_deployment_request.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class CreateRagDeploymentRequest(BaseModel):
3232
cluster_id: StrictInt
3333
hardware_instance_id: StrictInt
3434
recipe: CServeV2Recipe
35+
cserve_version: Optional[StrictStr] = None
3536
hf_token: Optional[StrictStr] = None
3637
llm_model: StrictStr
3738
centml_api_key: StrictStr
@@ -42,7 +43,7 @@ class CreateRagDeploymentRequest(BaseModel):
4243
endpoint_certificate_authority: Optional[StrictStr] = None
4344
concurrency: Optional[StrictInt] = None
4445
env_vars: Optional[Dict[str, StrictStr]] = None
45-
__properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "recipe", "hf_token", "llm_model", "centml_api_key", "min_scale", "max_scale", "initial_scale", "endpoint_bearer_token", "endpoint_certificate_authority", "concurrency", "env_vars"]
46+
__properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "recipe", "cserve_version", "hf_token", "llm_model", "centml_api_key", "min_scale", "max_scale", "initial_scale", "endpoint_bearer_token", "endpoint_certificate_authority", "concurrency", "env_vars"]
4647

4748
@field_validator('name')
4849
def name_validate_regular_expression(cls, value):
@@ -93,6 +94,11 @@ def to_dict(self) -> Dict[str, Any]:
9394
# override the default output from pydantic by calling `to_dict()` of recipe
9495
if self.recipe:
9596
_dict['recipe'] = self.recipe.to_dict()
97+
# set to None if cserve_version (nullable) is None
98+
# and model_fields_set contains the field
99+
if self.cserve_version is None and "cserve_version" in self.model_fields_set:
100+
_dict['cserve_version'] = None
101+
96102
# set to None if hf_token (nullable) is None
97103
# and model_fields_set contains the field
98104
if self.hf_token is None and "hf_token" in self.model_fields_set:
@@ -134,6 +140,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
134140
"cluster_id": obj.get("cluster_id"),
135141
"hardware_instance_id": obj.get("hardware_instance_id"),
136142
"recipe": CServeV2Recipe.from_dict(obj["recipe"]) if obj.get("recipe") is not None else None,
143+
"cserve_version": obj.get("cserve_version"),
137144
"hf_token": obj.get("hf_token"),
138145
"llm_model": obj.get("llm_model"),
139146
"centml_api_key": obj.get("centml_api_key"),
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# coding: utf-8
2+
3+
"""
4+
Platform External API
5+
6+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7+
8+
The version of the OpenAPI document: 0.1.0
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
11+
Do not edit the class manually.
12+
""" # noqa: E501
13+
14+
15+
from __future__ import annotations
16+
import pprint
17+
import re # noqa: F401
18+
import json
19+
20+
from pydantic import BaseModel, ConfigDict, StrictStr
21+
from typing import Any, ClassVar, Dict, List
22+
from platform_api_python_client.models.deployment_usage_value import DeploymentUsageValue
23+
from typing import Optional, Set
24+
from typing_extensions import Self
25+
26+
class DeploymentUsage(BaseModel):
27+
"""
28+
DeploymentUsage
29+
""" # noqa: E501
30+
metric: Dict[str, StrictStr]
31+
values: List[DeploymentUsageValue]
32+
__properties: ClassVar[List[str]] = ["metric", "values"]
33+
34+
model_config = ConfigDict(
35+
populate_by_name=True,
36+
validate_assignment=True,
37+
protected_namespaces=(),
38+
)
39+
40+
41+
def to_str(self) -> str:
42+
"""Returns the string representation of the model using alias"""
43+
return pprint.pformat(self.model_dump(by_alias=True))
44+
45+
def to_json(self) -> str:
46+
"""Returns the JSON representation of the model using alias"""
47+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48+
return json.dumps(self.to_dict())
49+
50+
@classmethod
51+
def from_json(cls, json_str: str) -> Optional[Self]:
52+
"""Create an instance of DeploymentUsage from a JSON string"""
53+
return cls.from_dict(json.loads(json_str))
54+
55+
def to_dict(self) -> Dict[str, Any]:
56+
"""Return the dictionary representation of the model using alias.
57+
58+
This has the following differences from calling pydantic's
59+
`self.model_dump(by_alias=True)`:
60+
61+
* `None` is only added to the output dict for nullable fields that
62+
were set at model initialization. Other fields with value `None`
63+
are ignored.
64+
"""
65+
excluded_fields: Set[str] = set([
66+
])
67+
68+
_dict = self.model_dump(
69+
by_alias=True,
70+
exclude=excluded_fields,
71+
exclude_none=True,
72+
)
73+
# override the default output from pydantic by calling `to_dict()` of each item in values (list)
74+
_items = []
75+
if self.values:
76+
for _item_values in self.values:
77+
if _item_values:
78+
_items.append(_item_values.to_dict())
79+
_dict['values'] = _items
80+
return _dict
81+
82+
@classmethod
83+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84+
"""Create an instance of DeploymentUsage from a dict"""
85+
if obj is None:
86+
return None
87+
88+
if not isinstance(obj, dict):
89+
return cls.model_validate(obj)
90+
91+
_obj = cls.model_validate({
92+
"metric": obj.get("metric"),
93+
"values": [DeploymentUsageValue.from_dict(_item) for _item in obj["values"]] if obj.get("values") is not None else None
94+
})
95+
return _obj
96+
97+

platform_api_python_client/models/get_c_serve_v2_deployment_response.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@ class GetCServeV2DeploymentResponse(BaseModel):
4040
created_at: datetime
4141
hardware_instance_id: StrictInt
4242
recipe: CServeV2Recipe
43+
cserve_version: Optional[StrictStr] = None
4344
min_scale: StrictInt
4445
max_scale: StrictInt
4546
initial_scale: Optional[StrictInt] = None
4647
endpoint_certificate_authority: Optional[StrictStr] = None
4748
endpoint_bearer_token: Optional[StrictStr] = None
4849
concurrency: Optional[StrictInt] = None
4950
env_vars: Optional[Dict[str, StrictStr]] = None
50-
__properties: ClassVar[List[str]] = ["cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "recipe", "min_scale", "max_scale", "initial_scale", "endpoint_certificate_authority", "endpoint_bearer_token", "concurrency", "env_vars"]
51+
__properties: ClassVar[List[str]] = ["cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "recipe", "cserve_version", "min_scale", "max_scale", "initial_scale", "endpoint_certificate_authority", "endpoint_bearer_token", "concurrency", "env_vars"]
5152

5253
model_config = ConfigDict(
5354
populate_by_name=True,
@@ -96,6 +97,11 @@ def to_dict(self) -> Dict[str, Any]:
9697
if self.image_url is None and "image_url" in self.model_fields_set:
9798
_dict['image_url'] = None
9899

100+
# set to None if cserve_version (nullable) is None
101+
# and model_fields_set contains the field
102+
if self.cserve_version is None and "cserve_version" in self.model_fields_set:
103+
_dict['cserve_version'] = None
104+
99105
# set to None if initial_scale (nullable) is None
100106
# and model_fields_set contains the field
101107
if self.initial_scale is None and "initial_scale" in self.model_fields_set:
@@ -138,6 +144,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
138144
"created_at": obj.get("created_at"),
139145
"hardware_instance_id": obj.get("hardware_instance_id"),
140146
"recipe": CServeV2Recipe.from_dict(obj["recipe"]) if obj.get("recipe") is not None else None,
147+
"cserve_version": obj.get("cserve_version"),
141148
"min_scale": obj.get("min_scale"),
142149
"max_scale": obj.get("max_scale"),
143150
"initial_scale": obj.get("initial_scale"),

platform_api_python_client/models/get_deployment_usage_response.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919

2020
from pydantic import BaseModel, ConfigDict
2121
from typing import Any, ClassVar, Dict, List
22-
from platform_api_python_client.models.deployment_usage_value import DeploymentUsageValue
22+
from platform_api_python_client.models.deployment_usage import DeploymentUsage
2323
from typing import Optional, Set
2424
from typing_extensions import Self
2525

2626
class GetDeploymentUsageResponse(BaseModel):
2727
"""
2828
GetDeploymentUsageResponse
2929
""" # noqa: E501
30-
values: List[DeploymentUsageValue]
30+
values: List[DeploymentUsage]
3131
__properties: ClassVar[List[str]] = ["values"]
3232

3333
model_config = ConfigDict(
@@ -88,7 +88,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
8888
return cls.model_validate(obj)
8989

9090
_obj = cls.model_validate({
91-
"values": [DeploymentUsageValue.from_dict(_item) for _item in obj["values"]] if obj.get("values") is not None else None
91+
"values": [DeploymentUsage.from_dict(_item) for _item in obj["values"]] if obj.get("values") is not None else None
9292
})
9393
return _obj
9494

0 commit comments

Comments
 (0)